Enter, Non-Push-Button, Mac - popposing change
Florian Kirmaier
florian.kirmaier at gmail.com
Wed Aug 12 08:25:52 UTC 2020
Hi everyone,
related ticket from the past:
https://bugs.openjdk.java.net/browse/JDK-8139509
Examples for ButtonTypes:
non-push-buttons: RadioButton, CheckBox
pushButtons: Button, ToggleButton
CurrentStatus:
Consumes EnterEvent Windows Mac
PushButton true false
NotPushButton true false
I propose changing this behavior to the following:
Consumes EnterEvent Windows Mac
PushButton true true
NotPushButton false false
Why?
On Windows, the non-push-buttons usually don't work on enter.
They only consume enter by accident because of the changes made, in
JDK-8139509.
So this should be changed, we should probably add a way to distinguish
between push and pushable buttons.
On Mac, I think normal buttons should also consume enter.
The OS-Dialogs don't have the concept focus, so they can't be used as a
reference.
On Safari, only TextFields can be focused but buttons can't be focused,
which isn't a real option for JavaFX.
On the other Browsers, they behave the same as Windows (Chrome Firefox).
Proposed Solution:
- Remove the not-mac-condition whether to decide we want to consume the
Enter-Event.
- Make push button distinguishable from other buttons, use it to decide
whether enter consumes the event
Advantages:
- Focused RadioButtons/Checkboxes etc. no longer block the DefaultButton
- Behavior would be the same on all Systems
- Enter on a mac would work again, which is the default on mac on browsers.
I've created a ticket for it:
https://bugs.openjdk.java.net/browse/JDK-8251472
Any opinions on the topic?
Greetings
Florian Kirmaier
More information about the openjfx-dev
mailing list