RFR: 8242553: IntegerSpinner and DoubleSpinner do not wrap around values correctly in some cases
Kevin Rushforth
kcr at openjdk.org
Tue Mar 26 21:27:26 UTC 2024
On Sun, 24 Mar 2024 15:11:16 GMT, drmarmac <duke at openjdk.org> wrote:
> This PR should fix the issue and cover all relevant cases with new tests.
>
> Note: This involves a small behavior change, as can be seen in dblSpinner_testWrapAround_decrement_twoSteps() in SpinnerTest.java:749. With this change the wraparound behavior is similar to that of the IntegerSpinner.
> There is one more unexpected behavior - I am going to mention it here, but it might need to be extracted into its own ticket (if people agree it's a bug):
>
> Consider a Spinner with a ListSpinnerValueFactory, initialized with a list of values let's say [ "one", "two", "three", "four" ]. Let's start with "one" as a selected value, and press the Down Arrow button. Since it is based on a list, and majority of human writing systems start at the top and go down (unless we are in Australia), I would expect "two" to appear. But no, we see "four", wait, why? Yes, it might operate with an integer index and treat down arrow button as decrementing that index, but it is so wrong [citation needed]. I would expect that in a list spinner, clicking the down arrow button should navigate to the next item _in the list_ ("as written") instead of going "up" the list.
This is definitely unrelated to this bug, so should be discussed separately. I can see your point, but this would be more than just a bug fix -- it would be a behavioral change that we would need to carefully consider.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1431#issuecomment-2021500457
More information about the openjfx-dev
mailing list