Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8251472

Enter, Non-Push-Button, Mac - proposing change

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • jfx11, jfx14
    • javafx
    • None

      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.


      Greetings
      Florian Kirmaier

            aghaisas Ajit Ghaisas
            fkirmaier Florian Kirmaier
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: