Skip to content

Commit 6202cbd

Browse files
authored
fix(ui5-switch): remove delegate focus of switch (#10798)
With change #10588 we addressed an issue, where the focus was being applied even if the root of the element (the touch area) was not clicked/touched, by removing the pointer events on host level. However this would've caused issues within cypress testing. To address the issue without breaking the cypress tests, we now remove the `delegateFocus` option, from the `shadowRootOptions`. By removing focus delegation, we stopped the automatic forwarding of focus. Now, only an explicit click on the focusable inner element results in it receiving focus.
1 parent 358b5de commit 6202cbd

File tree

2 files changed

+0
-3
lines changed

2 files changed

+0
-3
lines changed

packages/main/src/Switch.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ import switchCss from "./generated/themes/Switch.css.js";
5555
styles: switchCss,
5656
renderer: jsxRenderer,
5757
template: SwitchTemplate,
58-
shadowRootOptions: { delegatesFocus: true },
5958
})
6059
/**
6160
* Fired when the component checked state changes.

packages/main/src/themes/Switch.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
:host(:not([hidden])) {
55
display: inline-block;
6-
pointer-events: none;
76
}
87

98
.ui5-switch-root {
@@ -16,7 +15,6 @@
1615
cursor: pointer;
1716
outline: none;
1817
border-radius: var(--_ui5-switch-root-border-radius);
19-
pointer-events: all;
2018
}
2119

2220
.ui5-switch-root:not(.ui5-switch--no-label):not(.ui5-switch--semantic) {

0 commit comments

Comments
 (0)