Support :focus-visible CSS pseudoclass
Michael Strauß
michaelstrau2 at gmail.com
Wed Apr 21 18:17:54 UTC 2021
JavaFX currently doesn't support the :focus-visible CSS pseudoclass,
which allows developers to create styles that differentiate between
logical and visual focus. This severly limits developers from
implementing the look&feel of many contemporary UI designs. For
example, Microsoft's Fluent design uses modality-aware focus
indicators in almost all implementations.
I propose adding support for this pseudoclass with the following behavior:
The :focus-visible pseudoclass in JavaFX would be set in addition to
the :focused pseudoclass if a control gained focus as a consequence of
keyboard input. In all other cases, the :focus-visible pseudoclass
would not be set on a control.
Additionally, a control loses its :focus-visible pseudoclass if it
receives interaction with mouse or touch.
https://github.com/openjdk/jfx/pull/475
https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible
More information about the openjfx-dev
mailing list