Fix issue #9001 Make ConfigInputTextEnterKeepActive compatible with IsItemDeactivatedAfterEdit #9115
+13
−221
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #9001.
Summary
When
io.ConfigInputTextEnterKeepActiveis enabled, pressing Enter on a single-lineInputTextkeeps the widget active and selects the contents.However, in this mode the item is never considered "deactivated", so
IsItemDeactivatedAfterEdit()never fires and existing undo/finalization logic breaks.Issue
ConfigInputTextEnterKeepActive:IsItemDeactivatedAfterEdit()becomes true for one frame.ConfigInputTextEnterKeepActive:IsItemDeactivatedAfterEdit()is never triggered.IsItemDeactivatedAfterEdit()to finalize edits stops working.Fix
ConfigInputTextEnterKeepActiveis set, I:IsItemDeactivatedAfterEdit()is signaled as usual.InputTextfor the next frame and select its contents.IsItemDeactivatedAfterEdit()while keeping the behavior promised byConfigInputTextEnterKeepActive.Testing
IsItemDeactivatedAfterEdit()never triggered withConfigInputTextEnterKeepActiveenabled.IsItemDeactivatedAfterEdit()is true for one frame when pressing Enter, even with the config flag set.ConfigInputTextEnterKeepActive(unchanged behavior).InputTextexamples.