Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Topic B][Feature Request]: New focus handling behaviour #8322

Open
1 task done
ilhan007 opened this issue Feb 21, 2024 · 0 comments
Open
1 task done

[Topic B][Feature Request]: New focus handling behaviour #8322

ilhan007 opened this issue Feb 21, 2024 · 0 comments

Comments

@ilhan007
Copy link
Member

ilhan007 commented Feb 21, 2024

Feature Request Description

According to the latest visual and interaction designs, the focus should behave like this:

  • on desktop, always show a focus outline, no matter if the focus was received via mouse or keyboard
  • on mobile, show focus outline only when focus is received via external keyboard and never show focus when the element is receiving focus via touch.

Input elements remain unchanged - they always show focus as additional attention is needed.

To be clarified:

  • Select receives focus via keyboard on mobile, has an outline and can be opened with enter. The same is not the case for MultiCombobx and will be tacked separately.

Example implementation

#8253

Proposed Solution

A pure CSS solution is possible by using :focus-visible which will match only when focus is received via keyboard. This is sufficient for mobile.

For desktop, the :focusselector should be used with an additional attribute on the host manually set by the component.
Use :focus-within if a nested component can receive focus, such as a button with avatar, the avatar will get the focus when touched.

The manual attributes [focused] and setting them via focusin and focusout handlers is discouraged and should be clarified additionally.

Proposed Alternatives

No response

Organization

UI5

Additional Context

No response

Priority

None

Privacy Policy

  • I’m not disclosing any internal or sensitive information.
@ilhan007 ilhan007 changed the title [Feature Request]: [Feature Request]: New focus handling behaviour Feb 21, 2024
@ilhan007 ilhan007 changed the title [Feature Request]: New focus handling behaviour [Topic B][Feature Request]: New focus handling behaviour Feb 21, 2024
didip1000 added a commit that referenced this issue Apr 11, 2024
Button elements can now receive focus when using keyboards on mobile devices. Focus outline is now displayed via CSS pseudo-classes and no longer relies on using the[focused] attribute.

The following components were updated:
* ui5-button
* ui5-toggle-button
* ui5-segmented-button
* ui5-split-button

Fixes: #8178
Related to: #8322

Co-authored-by: Peter Skelin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

2 participants