RFR: 8091673: Public focus traversal API for use in custom controls [v3]
Andy Goryachev
angorya at openjdk.org
Mon Oct 28 17:37:10 UTC 2024
On Mon, 28 Oct 2024 17:28:55 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:
>> I do not. Why do you say that?
>
> Because `focusVisible` is specified to _only_ be set as a result of keyboard navigation, not as a result of programmatic navigation.
>
> `Node.focusVisible` specifies:
>
> /**
> * Indicates whether this {@code Node} should visibly indicate focus.
> * This flag is set when the node acquires input focus via keyboard navigation,
> * and it is cleared when the node loses focus or when {@link #requestFocus()}
> * is called.
> *
> * @defaultValue false
> * @since 19
> */
>
>
> The [JBS issue](https://bugs.openjdk.org/browse/JDK-8268225) says:
>> For JavaFX, "Node.focusVisible" would be set in addition to "Node.focused" if a scene graph node gained focus as a consequence of keyboard input. In all other cases, "Node.focusVisible" would not be set on a node.
To clarify, this PR changes nothing in the way FX behaves in relation to focus. Nothing. I only provided a public API for use in custom controls.
So whatever discrepancy between FX and w3.org spec you mention (not sure why, this isn't an FX spec) applies equally to the existing implementation (if not, please let me know - you found a bug).
However, perhaps, you pointing out that the docs may be improved - and you are doing so in a very difficult manner. Or maybe you are pointing out the fact that we should bring back the traverse(Node, TraversalDirection, boolean focusVisible) call?
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1604#discussion_r1819476670
More information about the openjfx-dev
mailing list