diff --git a/packages/main/src/Popup.hbs b/packages/main/src/Popup.hbs index 08f6abb946ba..14a193af446d 100644 --- a/packages/main/src/Popup.hbs +++ b/packages/main/src/Popup.hbs @@ -5,6 +5,7 @@ style="{{styles.root}}" class="{{classes.root}}" role="{{_role}}" + tabindex="-1" aria-modal="{{_ariaModal}}" aria-label="{{_ariaLabel}}" aria-labelledby="{{_ariaLabelledBy}}" diff --git a/packages/main/src/Popup.ts b/packages/main/src/Popup.ts index 3ca6287c5a18..8209f07277e1 100644 --- a/packages/main/src/Popup.ts +++ b/packages/main/src/Popup.ts @@ -8,7 +8,6 @@ import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js"; import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js"; import { isChrome, - isSafari, isDesktop, isPhone, } from "@ui5/webcomponents-base/dist/Device.js"; @@ -249,6 +248,8 @@ abstract class Popup extends UI5Element { if (isDesktop()) { this.setAttribute("desktop", ""); } + + this.tabIndex = -1; } onExitDOM() { @@ -390,10 +391,6 @@ abstract class Popup extends UI5Element { } _onmousedown(e: MouseEvent) { - if (!isSafari()) { // Remove when adopting native dialog - this._root.removeAttribute("tabindex"); - } - if (this.shadowRoot!.contains(e.target as HTMLElement)) { this._shouldFocusRoot = true; } else { @@ -402,10 +399,6 @@ abstract class Popup extends UI5Element { } _onmouseup() { - if (!isSafari()) { // Remove when adopting native dialog - this._root.tabIndex = -1; - } - if (this._shouldFocusRoot) { if (isChrome()) { this._root.focus(); @@ -476,9 +469,6 @@ abstract class Popup extends UI5Element { element = element || await getFirstFocusableElement(this) || this._root; // in case of no focusable content focus the root if (element) { - if (element === this._root) { - element.tabIndex = -1; - } element.focus(); } } diff --git a/packages/main/test/pages/Popover.html b/packages/main/test/pages/Popover.html index f946155dd32d..01c900f3883f 100644 --- a/packages/main/test/pages/Popover.html +++ b/packages/main/test/pages/Popover.html @@ -487,9 +487,21 @@

Horizontal Align

Content
Footer
-
-
+

Inputs with value state

+
+ + + some text + +
+ +
+

Open and scroll

@@ -499,7 +511,8 @@

Open and scroll

- +
+