-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cancelling edit doesn't reset the input buffer #2321
Comments
Thank you for finding this @relick. It somehow escaped naive detection because applying the zero-terminator means that text addition would appear to be successfully cancelled. "Hello" -> "Hello world" (Escape) -> "Hello" (appears to work!) Broken in Fixed now. However I noticed there is another bug where if you enable Keyboard Navigation, in this situation the Nav code will consume the ESC event earlier and not leave a chance for |
( I also added a basic test for test in my (work in progress) testing framework #435
) |
Awesome, thanks! |
Is there a way to allow this behavior. I'm trying to prevent the cancel behavior from happening. |
Version/Branch of Dear ImGui:
Version: 1.67 and master
Branch: master
Back-end/Renderer/Compiler/OS
Tested using:
Back-ends: imgui-SFML
Compiler: mingw-w64 gcc 8.2
Operating System: Windows
My Issue/Question:
When typing in an
InputText
orInputTextMultiline
and cancelling the edit (typically through pressing escape), whilst the text box does lose focus as expected, the input text buffer doesn't revert to its original contents. Reverting used to be the behaviour in previous versions but now seems to be broken on both 1.67 and master. Looking at the code it seems this may have just been an oversight when InputText resize callbacks were added.I was able to fix it locally by changing this line in InputTextEx:
to
If you'd like me to submit a PR for this fix let me know, but I'll wait for now in case there's an aspect to fixing this that I have missed.
The text was updated successfully, but these errors were encountered: