Skip to content

Commit

Permalink
fix(core/blind): use string value für aria
Browse files Browse the repository at this point in the history
  • Loading branch information
danielleroux committed Apr 3, 2023
1 parent db091cc commit cb8a6de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/components/blind/blind.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
Watch,
} from '@stencil/core';
import anime from 'animejs';
import { a11yBoolean } from '../utils/a11y';

let sequentialInstanceId = 0;
@Component({
Expand Down Expand Up @@ -128,7 +129,7 @@ export class Blind {
type="button"
aria-labelledby={`ix-blind-header-title-${this.id}`}
aria-controls={`ix-blind-content-section-${this.id}`}
aria-expanded={!this.collapsed}
aria-expanded={a11yBoolean(!this.collapsed)}
onClick={(e) => this.onHeaderClick(e)}
>
<span
Expand Down
9 changes: 9 additions & 0 deletions packages/core/src/components/utils/a11y.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* SPDX-FileCopyrightText: 2023 Siemens AG
*
* SPDX-License-Identifier: MIT
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
export const a11yBoolean = (value: boolean) => (value ? 'true' : 'false');

0 comments on commit cb8a6de

Please sign in to comment.