ToggleButton behavior
Andy Goryachev
andy.goryachev at oracle.com
Thu Dec 7 20:40:27 UTC 2023
Dear Martin:
It's hard to say. How does it work in Swing?
There is also https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/radio_role
I always felt that the focus management in JavaFX is underdeveloped: multiple focused nodes, nodes getting simultaneous input, lack of coherent geometry-based focus traversal policy, and a lack of public APIs for a custom focus traversal policy.
Are there any ideas?
-andy
From: openjfx-dev <openjfx-dev-retn at openjdk.org> on behalf of Martin Fox <martin at martinfox.com>
Date: Saturday, December 2, 2023 at 17:58
To: John Hendrikx <john.hendrikx at gmail.com>
Cc: openjfx-dev <openjfx-dev at openjdk.org>
Subject: Re: ToggleButton behavior
I took a look at the W3C accessibility guidelines for radio button groups<https://www.w3.org/wiki/RadioButton> since that’s the closest thing I could find to a group of ToggleButtons. The W3C suggests that Tab/Shift+Tab takes you in and out of the group and the arrow keys navigate within the group with wrap-around. Based on that (3) is correct.
That’s where the W3C guidance ends; a single radio button doesn’t make much sense so it’s not even mentioned. I would expect a single ungrouped ToggleButton to navigate like a checkbox so (1) seems wrong. A group with just one ToggleButton is an odd thing so (2) could go either way.
Martin
On Dec 1, 2023, at 11:21 PM, John Hendrikx <john.hendrikx at gmail.com> wrote:
In my exploration of a potential Behavior API, I discovered this oddity in how ToggleButtons work.
1. If you have a single ToggleButton that is not part of a ToggleGroup, you can't navigate away from it with the arrow keys, only by using Tab or Shift-Tab.
2. If you have that same single ToggleButton, but it does have a group (a group of one) then you CAN navigate away from it with the arrow keys.
3. When you have two ToggleButtons, both part of the same group, then you can only navigate away from the group with Tab or Shift-Tab again, as the arrow keys will loop back to the first/last button when the end of the group is reached.
I get the impression at least one of these is incorrect.
I mean, either ToggleButtons should always loop, even if it is a group of one, meaning (2) would be incorrect...
Or... ToggleButtons should never loop, in which case (1) and (3) are incorrect...
Or... Single ToggleButtons (grouped or not) behave differently and don't do looping, in which case (1) is incorrect
Thoughts?
--John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20231207/0e6eebb4/attachment-0001.htm>
More information about the openjfx-dev
mailing list