Skip to content

Commit 1f47658

Browse files
committed
Make usage of the proper methods to set A11Y attrs
1 parent 4176d89 commit 1f47658

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

src/scripts/OSFramework/OSUI/Pattern/BottomSheet/BottomSheet.ts

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -238,22 +238,13 @@ namespace OSFramework.OSUI.Patterns.BottomSheet {
238238
Helper.A11Y.RoleComplementary(this.selfElement);
239239
}
240240

241-
Helper.Dom.Attribute.Set(
242-
this.selfElement,
243-
Constants.A11YAttributes.Aria.Hidden,
244-
(!this._isOpen).toString()
245-
);
246-
247-
Helper.Dom.Attribute.Set(
248-
this.selfElement,
249-
Constants.A11YAttributes.TabIndex,
250-
this._isOpen
251-
? Constants.A11YAttributes.States.TabIndexShow
252-
: Constants.A11YAttributes.States.TabIndexHidden
253-
);
254-
255-
// Will handle the tabindex value of the elements inside pattern
256-
Helper.A11Y.SetElementsTabIndex(this._isOpen, this._focusTrapInstance.focusableElements);
241+
if (this._isOpen) {
242+
Helper.A11Y.TabIndexTrue(this.selfElement);
243+
Helper.A11Y.AriaHiddenFalse(this.selfElement);
244+
} else {
245+
Helper.A11Y.TabIndexFalse(this.selfElement);
246+
Helper.A11Y.AriaHiddenTrue(this.selfElement);
247+
}
257248
}
258249

259250
/**

0 commit comments

Comments
 (0)