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, inJDK-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.
Greetings
Florian Kirmaier
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
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.
Greetings
Florian Kirmaier
- relates to
-
JDK-8238078 Enter button inconsistency in a Confirmation dialog
-
- Open
-
-
JDK-8139509 A buttons onActionEvent must be triggered also on RETURN
-
- Resolved
-