Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use inert on host elements instead of aria-hidden when host element is hidden #11056

Merged
merged 4 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/calcite-components/src/components/alert/alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
focusFirstTabbable,
setRequestedIcon,
slotChangeHasAssignedElement,
toAriaBoolean,
} from "../../utils/dom";
import { MenuPlacement } from "../../utils/floating-ui";
import { getIconScale } from "../../utils/component";
Expand Down Expand Up @@ -408,7 +407,7 @@ export class Alert extends LitElement implements OpenCloseComponent, LoadableCom
const effectiveIcon = setRequestedIcon(KindIcons, this.icon, this.kind);
const hasQueuedAlerts = openAlertCount > 1;
/* TODO: [MIGRATION] This used <Host> before. In Stencil, <Host> props overwrite user-provided props. If you don't wish to overwrite user-values, replace "=" here with "??=" */
this.el.ariaHidden = toAriaBoolean(hidden);
this.el.inert = hidden;
/* TODO: [MIGRATION] This used <Host> before. In Stencil, <Host> props overwrite user-provided props. If you don't wish to overwrite user-values, replace "=" here with "??=" */
this.el.ariaLabel = label;
this.el.toggleAttribute("calcite-hydrated-hidden", hidden);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ export class Popover
<FloatingArrow floatingLayout={floatingLayout} key="floating-arrow" ref={this.storeArrowEl} />
) : null;
/* TODO: [MIGRATION] This used <Host> before. In Stencil, <Host> props overwrite user-provided props. If you don't wish to overwrite user-values, replace "=" here with "??=" */
this.el.ariaHidden = toAriaBoolean(hidden);
this.el.inert = hidden;
/* TODO: [MIGRATION] This used <Host> before. In Stencil, <Host> props overwrite user-provided props. If you don't wish to overwrite user-values, replace "=" here with "??=" */
this.el.ariaLabel = label;
/* TODO: [MIGRATION] This used <Host> before. In Stencil, <Host> props overwrite user-provided props. If you don't wish to overwrite user-values, replace "=" here with "??=" */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
JsxNode,
setAttribute,
} from "@arcgis/lumina";
import { toAriaBoolean } from "../../utils/dom";
import {
connectFloatingUI,
defaultOffsetDistance,
Expand Down Expand Up @@ -313,7 +312,7 @@ export class Tooltip extends LitElement implements FloatingUIComponent, OpenClos
const displayed = referenceEl && open;
const hidden = !displayed;
/* TODO: [MIGRATION] This used <Host> before. In Stencil, <Host> props overwrite user-provided props. If you don't wish to overwrite user-values, replace "=" here with "??=" */
this.el.ariaHidden = toAriaBoolean(hidden);
this.el.inert = hidden;
/* TODO: [MIGRATION] This used <Host> before. In Stencil, <Host> props overwrite user-provided props. If you don't wish to overwrite user-values, replace "=" here with "??=" */
this.el.ariaLabel = label;
/* TODO: [MIGRATION] This used <Host> before. In Stencil, <Host> props overwrite user-provided props. If you don't wish to overwrite user-values, replace "=" here with "??=" */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ describe("calcite-tree-item", () => {
await btn.click();

const item = await page.find("#newbie");
expect(item).toEqualAttribute("aria-hidden", "false");
expect(item.inert).toBe(false);
expect(item.tabIndex).toBe(0);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ export class TreeItem extends LitElement implements InteractiveComponent {
/* TODO: [MIGRATION] This used <Host> before. In Stencil, <Host> props overwrite user-provided props. If you don't wish to overwrite user-values, replace "=" here with "??=" */
this.el.ariaExpanded = this.hasChildren ? toAriaBoolean(isExpanded) : undefined;
/* TODO: [MIGRATION] This used <Host> before. In Stencil, <Host> props overwrite user-provided props. If you don't wish to overwrite user-values, replace "=" here with "??=" */
this.el.ariaHidden = toAriaBoolean(hidden);
this.el.inert = hidden;
/* TODO: [MIGRATION] This used <Host> before. In Stencil, <Host> props overwrite user-provided props. If you don't wish to overwrite user-values, replace "=" here with "??=" */
this.el.ariaLive = "polite";
/* TODO: [MIGRATION] This used <Host> before. In Stencil, <Host> props overwrite user-provided props. If you don't wish to overwrite user-values, replace "=" here with "??=" */
Expand Down
Loading