<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Hi Andy,<div><br></div><div>The Mozilla doc you pointed to basically re-iterates the W3C guidelines. When a ToggleButton is in a group it should behave like other grouped controls where Tab gets you into and out of the group and the arrow keys navigate within the group. I would still argue that an ungrouped ToggleButton should traverse like any other button.</div><div><br></div><div>I’m not familiar enough with JavaFX’s focus traversal implementation to have an opinion. Based on past experience I wouldn’t wade into those waters until I had a plan in place for how to validate the results. In my previous job we did a big accessibility push and ended up assigning one engineer whose primary job was liaising with accessibility tool vendors to make sure we got it right. She was worth her weight in gold. </div><div><br></div><div>(Whatever happened to the issue where multiple nodes in a scene can set their focused property? As I recall someone on the controls side needed to dig in and figure out what was going on there.)</div><div><br></div><div>Martin</div><div><div><br><blockquote type="cite"><div>On Dec 7, 2023, at 12:40 PM, Andy Goryachev <andy.goryachev@oracle.com> wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Optima-Regular; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt; font-family: "Iosevka Fixed SS16";">Dear Martin:<o:p></o:p></span></div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt; font-family: "Iosevka Fixed SS16";"><o:p> </o:p></span></div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt; font-family: "Iosevka Fixed SS16";">It's hard to say.  How does it work in Swing?<o:p></o:p></span></div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt; font-family: "Iosevka Fixed SS16";"><o:p> </o:p></span></div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt; font-family: "Iosevka Fixed SS16";">There is also<span class="Apple-converted-space"> </span><a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/radio_role" style="color: blue; text-decoration: underline;">https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/radio_role</a><o:p></o:p></span></div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt; font-family: "Iosevka Fixed SS16";"><o:p> </o:p></span></div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt; font-family: "Iosevka Fixed SS16";">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.<o:p></o:p></span></div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt; font-family: "Iosevka Fixed SS16";"><o:p> </o:p></span></div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt; font-family: "Iosevka Fixed SS16";">Are there any ideas?<o:p></o:p></span></div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt; font-family: "Iosevka Fixed SS16";"><o:p> </o:p></span></div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt; font-family: "Iosevka Fixed SS16";">-andy<o:p></o:p></span></div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt; font-family: "Iosevka Fixed SS16";"><o:p> </o:p></span></div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt; font-family: "Iosevka Fixed SS16";"><o:p> </o:p></span></div><div id="mail-editor-reference-message-container"><div><div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) currentcolor currentcolor; border-image: none; padding: 3pt 0in 0in;"><p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 10pt; font-family: Calibri, sans-serif;"><b><span style="font-size: 12pt;">From:<span class="Apple-converted-space"> </span></span></b><span style="font-size: 12pt;">openjfx-dev <openjfx-dev-retn@openjdk.org> on behalf of Martin Fox <martin@martinfox.com><br><b>Date:<span class="Apple-converted-space"> </span></b>Saturday, December 2, 2023 at 17:58<br><b>To:<span class="Apple-converted-space"> </span></b>John Hendrikx <john.hendrikx@gmail.com><br><b>Cc:<span class="Apple-converted-space"> </span></b>openjfx-dev <openjfx-dev@openjdk.org><br><b>Subject:<span class="Apple-converted-space"> </span></b>Re: ToggleButton behavior<o:p></o:p></span></p></div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">I took a look at the <a href="https://www.w3.org/wiki/RadioButton" style="color: blue; text-decoration: underline;">W3C accessibility guidelines for radio button groups</a> 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.<o:p></o:p></span></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"><o:p> </o:p></span></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">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.<o:p></o:p></span></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"><o:p> </o:p></span></div></div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">Martin<o:p></o:p></span></div></div><div><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"><br><br><o:p></o:p></span></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt;"><div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">On Dec 1, 2023, at 11:21 PM, John Hendrikx <john.hendrikx@gmail.com> wrote:<o:p></o:p></span></div></div><div style="margin: 0in; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"><o:p> </o:p></span></div><div><div><p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 10pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">In my exploration of a potential Behavior API, I discovered this oddity in how ToggleButtons work.<br><br>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.<br><br>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.<br><br>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.<br><br>I get the impression at least one of these is incorrect.<br><br>I mean, either ToggleButtons should always loop, even if it is a group of one, meaning (2) would be incorrect...<br><br>Or... ToggleButtons should never loop, in which case (1) and (3) are incorrect...<br><br>Or... Single ToggleButtons (grouped or not) behave differently and don't do looping, in which case (1) is incorrect<br><br>Thoughts?<br><br>--John</span></p></div></div></blockquote></div></div></div></div></div></div></blockquote></div><br></div></body></html>