[Topic RL][Feature Request]: New focus handling behaviour
@hristop is already working on this.
Since Feb 21, 2024.
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 285
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 59
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.