On Tue, 19 May 2026 15:16:22 GMT, Martin Fox <[email protected]> wrote:
>> This PR alters the way ComboBox and Spinner deliver KeyEvents to their >> TextField editors. When a ComboBox or Spinner is the focus owner it is the >> target of all key events. Currently the skin installs a filter to catch key >> events and re-fire most of them at the TextEdit. The skin copies the event, >> fires the copy at the TextField, and then consumes the original event. This >> confuses the system menu bar logic on macOS; only the original event can >> trigger a menu item and that event is always being consumed. >> >> In this PR only the original key event makes its way up and down the event >> dispatch chain. To drive the TextField the skin delivers the event copy >> directly to the TextField's event dispatcher and only consumes the original >> event if the TextField consumes the copy. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Martin Fox has updated the pull request incrementally with one additional > commit since the last revision: > > Moved event dispatching utility to skin Utils modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/skin/Utils.java line 998: > 996: // Dispatches the event to the Node's dispatcher and returns > 997: // true if the event was consumed. > 998: public static boolean dispatchToNode(Event event, Node node) { thank you! last thing (sorry!) - would it make sense to also describe in the comment that this event bypasses the usual chain, or words to this effect? ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/2166#discussion_r3267474589
