On Mon, 3 Mar 2025 12:11:30 GMT, Abhishek Kumar <abhis...@openjdk.org> wrote:

>> VoiceOver is unable to announce the correct value for spinner. For JSpinner 
>> with maximum value of more than 10, VO announce 10 as 1, 20 as 2 and so on. 
>> Probable reason is the "ACCESSIBLE_TEXT_PROPERTY" fired by accessible 
>> JTextComponent that leads to wrong range value invoked for accessibility API 
>> by VO.
>> Workaround fix is to ensure "ACCESSIBLE_TEXT_PROPOERTY" is not fired in case 
>> of JSpinner with numeric values.
>> 
>> Since the fix is in Java Component, verified fix with JAWS on windows. I 
>> don't see any side effects in announcement.
>> Manual test case is added to verify the fix.
>> 
>> CI pipeline testing is ok for the proposed fix.
>
> Abhishek Kumar has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Fix pushed to mac os specific class

src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessible.java line 127:

> 125:                     AccessibleContext thisAC = 
> accessible.getAccessibleContext();
> 126:                     Accessible parentAccessible = 
> thisAC.getAccessibleParent();
> 127:                     if (!(parentAccessible instanceof 
> JSpinner.NumberEditor)) {

Why do you need all this if the spinner has an accessible role?
```jdk-21.0.6+7/src/java.desktop/share/classes/javax/swing/JSpinner.java```

        public AccessibleRole getAccessibleRole() {
            return AccessibleRole.SPIN_BOX;
        }

Also, there is already getting an a11y parent lower in the code.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/23841#discussion_r1977592083

Reply via email to