RFR: 8337246: SpinnerSkin does not consume ENTER KeyEvent when editor ActionEvent is consumed

Martin Fox mfox at openjdk.org
Fri Nov 8 00:37:46 UTC 2024


On Thu, 7 Nov 2024 14:40:43 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

> The failing `SpinnerTest::testEnterEscapeKeysWithDefaultCancelButtons` test is a bit odd; it expects that Enter in an **editable** Spinner should result in activating the Default Button. However, a normal TextField doesn't do this either...

Maybe I'm misunderstanding this comment but in my testing pressing Enter in an editable TextField can activate the default button as long as the TextField doesn't have an OnAction handler set. It should not be so easy to block Enter from activating the default button.

It might be helpful to write up a single test that verifies that Enter is handled correctly for TextField, ComboBox, DatePicker, and Spinner. I'm working on a PR to clean up ESC handling and it was useful to write up a single test covering all of these controls. (I want to ensure that the user can always uses ESC to close a modal dialog even if the TextField has a formatter assigned to it. This isn't working currently.)

Why doesn't Spinner work the same as ComboBox? For a ComboBox the client registers the action handler directly on the ComboBox instead of the combo box's editor.

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

PR Comment: https://git.openjdk.org/jfx/pull/1629#issuecomment-2463491419


More information about the openjfx-dev mailing list