Skip to content

Conversation

@hinzzx
Copy link
Contributor

@hinzzx hinzzx commented Jan 20, 2025

Previously on our ui5-switch component, focus was being applied even if the root element was not clicked.

With this change, focus is applied only when the ui5-switch's touch area is clicked.

Before

2025-01-20_09-03-48

After

2025-01-20_09-04-12

Fixes: #10567

@hinzzx hinzzx requested a review from unazko January 23, 2025 07:28
@hinzzx hinzzx marked this pull request as ready for review January 27, 2025 15:15
@hinzzx hinzzx merged commit 6ff93c5 into main Jan 27, 2025
10 checks passed
@hinzzx hinzzx deleted the switch-foc-fix branch January 27, 2025 15:21
@ui5-webcomponents-bot
Copy link
Collaborator

🎉 This PR is included in version v2.7.0-rc.2 🎉

The release is available on v2.7.0-rc.2

Your semantic-release bot 📦🚀

hinzzx added a commit that referenced this pull request Mar 13, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ui5-switch]: focus on click

4 participants