JDK-8088897 : Menu.onAction may not be called when TextInputControl node is focused
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: 7u6
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2012-06-12
  • Updated: 2022-01-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Blocks :  
Blocks :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
Start simple test case attached.
When you enter some text in the TextField, then use shortcut for the undo action (ctl / cmd Z), the text is updated to its previous value BUT the undoMenu.onAction is not called.
When you enter some text in the ComboBox text field, then use shortcut for the undo action, the text is updated AND the undoMenu.onAction is called.
This behavior is not homogeneous.

Finally, if you use the system menu bar, you will get the text updated AND the menu.onAction called in both cases.
I think this is the correct behavior.
Comments
TextFields and ComboBoxes now behave the same and correctly consume the event. The problem with the systemMenuBar is in the glass code, the shortcut is routed through performKeyEquivalent which returns NO so it also is processed by the main NSMenu.
19-01-2022

A key event should not be used by both shortcuts and the focused control. Currently, the focused control gets it first and consumes it, but I would argue that shortcuts should always get a chance to fire first. Maybe this issue should be reassigned to the scenegraph team for evaluation.
12-06-2012

This is the case for all actions defined in TextInputControlBindings (not only UNDO).
12-06-2012