Skip to content

Commit

Permalink
refactor: use inert attribute instead of property hack (#3099)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeripeierSBB authored Sep 19, 2024
1 parent dfd741f commit fdd2862
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/elements/core/controllers/inert-controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('inert', () => {
element = await fixture(
html`<div>
<div></div>
<div .inert=${true}></div>
<div inert></div>
<div aria-hidden="true"></div>
<div id="overlay"></div>
<div>
Expand Down Expand Up @@ -117,7 +117,7 @@ describe('inert', () => {
element = await fixture(
html`<div>
<div></div>
<div .inert=${true}></div>
<div inert></div>
<div aria-hidden="true"></div>
<shadow-element></shadow-element>
<div>
Expand Down
2 changes: 1 addition & 1 deletion src/elements/map-container/map-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class SbbMapContainerElement extends LitElement {
icon-name="location-pin-map-small"
type="button"
@click=${() => this._onScrollButtonClick()}
.inert=${!this._scrollUpButtonVisible}
?inert=${!this._scrollUpButtonVisible}
>
${i18nMapContainerButtonLabel[this._language.current]}
</sbb-tertiary-button>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export class SbbSelectionExpansionPanelElement extends SbbHydrationMixin(LitElem
</div>
<div
class="sbb-selection-expansion-panel__content--wrapper"
.inert=${this._state !== 'opened'}
?inert=${this._state !== 'opened'}
@animationend=${(event: AnimationEvent) => this._onAnimationEnd(event)}
>
<div class="sbb-selection-expansion-panel__content">
Expand Down
2 changes: 1 addition & 1 deletion src/elements/toggle/toggle-option/toggle-option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class SbbToggleOptionElement extends SbbIconNameMixin(LitElement) {
id="sbb-toggle-option-id"
aria-hidden="true"
tabindex="-1"
.inert=${this.checked}
?inert=${this.checked}
?disabled=${this.disabled}
.checked=${this.checked || nothing}
.value=${this.value || nothing}
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
},
"globalAttributes": [
"align-self",
"inert",
"sbb-dialog-close",
"sbb-navigation-close",
"sbb-navigation-section-close",
Expand Down

0 comments on commit fdd2862

Please sign in to comment.