[External] : Re: ESC key binding on the Scene
Andy Goryachev
andy.goryachev at oracle.com
Tue Nov 21 21:04:08 UTC 2023
Created https://bugs.openjdk.org/browse/JDK-8320557
Feel free to add additional details.
-andy
From: openjfx-dev <openjfx-dev-retn at openjdk.org> on behalf of Andy Goryachev <andy.goryachev at oracle.com>
Date: Tuesday, November 21, 2023 at 12:39
To: Thiago Milczarek Sayão <thiago.sayao at gmail.com>
Cc: openjfx-dev <openjfx-dev at openjdk.org>
Subject: Re: [External] : Re: ESC key binding on the Scene
So it might be a bug in TextInputControl/TextField/TextArea - they should not consume events if there is nothing to cancel. I see there are more scenarios like this, to be solved with the InputMap proposal currently being discussed.
I’ll create a separate bug.
Thank you!
-andy
From: Thiago Milczarek Sayão <thiago.sayao at gmail.com>
Date: Tuesday, November 21, 2023 at 12:14
To: Andy Goryachev <andy.goryachev at oracle.com>
Cc: openjfx-dev <openjfx-dev at openjdk.org>
Subject: [External] : Re: ESC key binding on the Scene
Andy,
I think you're right about the formatter.
The idea was to let the key propagate if there's nothing to cancel.
For example:
If I want to cancel the edit, one ESC. The second ESC would propagate because there's nothing to cancel.
Thank you for the reply.
Em ter., 21 de nov. de 2023 às 14:36, Andy Goryachev <andy.goryachev at oracle.com<mailto:andy.goryachev at oracle.com>> escreveu:
Dear Thiago:
I don’t think it’s related to undo but to a TextField with a formatter.
The question is - do you want to disable the standard behavior (updating the text using the formatter on ESCAPE) completely? Or perhaps you do want to let TextField invoke cancelEdit() (see TextInputControlBehavior:178) and then close the stage?
In the latter case you might consider adding an event filter on the Stage and calling hide() from there in a Platform.runLater()
What do you think?
-andy
From: openjfx-dev <openjfx-dev-retn at openjdk.org<mailto:openjfx-dev-retn at openjdk.org>> on behalf of Thiago Milczarek Sayão <thiago.sayao at gmail.com<mailto:thiago.sayao at gmail.com>>
Date: Tuesday, November 21, 2023 at 02:37
To: openjfx-dev <openjfx-dev at openjdk.org<mailto:openjfx-dev at openjdk.org>>
Subject: ESC key binding on the Scene
Hi,
I would like to use ESC to close Stages. The problem is that if the focus is on a TextField, it consumes the event.
ESC is the key binding to Undo on the TextField, but it's always consumed, even if there's nothing to undo.
Is this correct? Should it not propagate if there's nothing to undo?
-- Thiago.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20231121/c4bc0161/attachment-0001.htm>
More information about the openjfx-dev
mailing list