Skip to content

Commit 85bd71b

Browse files
authored
fix(block): provide textual name on collapse and expansion to AT (#7652)
**Related Issue:** #5565 ## Summary Prior to this proposed fix, NVDA and JAWS were only receiving context that the `block` was expanded or collapsed due to the `title` prop. Updates include: - Adds an `aria-describedby` to provide context of the collapse/expansion in addition to the header (handled via the `id`) - Adds the `"header"` `id` to the block's `resources.ts`
1 parent 784cc25 commit 85bd71b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/calcite-components/src/components/block/block.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ export class Block
279279
const toggleLabel = open ? messages.collapse : messages.expand;
280280

281281
const headerContent = (
282-
<header class={CSS.header}>
282+
<header class={CSS.header} id={IDS.header}>
283283
{this.renderIcon()}
284284
{this.renderTitle()}
285285
</header>
@@ -295,6 +295,7 @@ export class Block
295295
{collapsible ? (
296296
<button
297297
aria-controls={IDS.content}
298+
aria-describedby={IDS.header}
298299
aria-expanded={collapsible ? toAriaBoolean(open) : null}
299300
class={CSS.toggle}
300301
id={IDS.toggle}

packages/calcite-components/src/components/block/resources.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export const IDS = {
22
content: "content",
33
toggle: "toggle",
4+
header: "header",
45
};
56

67
export const CSS = {

0 commit comments

Comments
 (0)