TextEdit
does not "consume" keypresses it reacts to, leading to both the widget and app reacting to the same keypress
#5609
Labels
bug
Something is broken
Describe the bug
TextEdit
(and maybe other widgets) reacts toEsc
to defocus. If the application checksctx.input()
and!wants_keyboard_input()
to useEscape
as a shortcut for, e.g. a Cancel button, then when aTextEdit
is focused and the user hitsEsc
to defocus it (hoping to revert their edits), then theTextEdit
correctly defocuses, and clears thewants_keyboard_input()
flag, which leads the app to incorrectly react to theEsc
, so Esc double-acts by (a) cancelling focus and (b) doing whatever Cancel does.To Reproduce
Steps to reproduce the behavior:
TextEdit
that does somethingctx.input()
forEscape
to be released when!wants_keyboard_input()
.TextEdit
Esc
TextEdit
defocuses, and thatwants_keyboard_input()
goes false leading the app to also detect anEscape
releaseExpected behavior
The
TextEdit
and other widgets (for example, modals) should "consume" the events they process so that code later in the frame does not also react to those events.egui:
0.30
The text was updated successfully, but these errors were encountered: