Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@XttZjj
Copy link

@XttZjj XttZjj commented Dec 8, 2025

Fixes #9001.

Summary

When io.ConfigInputTextEnterKeepActive is enabled, pressing Enter on a single-line InputText keeps 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

  • Without ConfigInputTextEnterKeepActive:
    • Pressing Enter deactivates the item, and IsItemDeactivatedAfterEdit() becomes true for one frame.
  • With ConfigInputTextEnterKeepActive:
    • Pressing Enter keeps the item active, and IsItemDeactivatedAfterEdit() is never triggered.
  • This is the situation described in IsItemDeactivatedAfterEdit doesn't play nicely with ConfigInputTextEnterKeepActive #9001, where code that relies on IsItemDeactivatedAfterEdit() to finalize edits stops working.

Fix

  • On Enter, when ConfigInputTextEnterKeepActive is set, I:
    • Let the widget go through the normal "deactivated after edit" path so that IsItemDeactivatedAfterEdit() is signaled as usual.
    • Immediately reactivate the same InputText for the next frame and select its contents.
  • This preserves the existing idiomatic use of IsItemDeactivatedAfterEdit() while keeping the behavior promised by ConfigInputTextEnterKeepActive.

Testing

  • Reproduced the behavior described in IsItemDeactivatedAfterEdit doesn't play nicely with ConfigInputTextEnterKeepActive #9001:
    • IsItemDeactivatedAfterEdit() never triggered with ConfigInputTextEnterKeepActive enabled.
  • Verified after the patch:
    • IsItemDeactivatedAfterEdit() is true for one frame when pressing Enter, even with the config flag set.
    • Focus remains on the input and text is selected as before.
  • Also checked:
    • Pressing Enter without ConfigInputTextEnterKeepActive (unchanged behavior).
    • Clicking outside the widget to deactivate.
    • No regressions observed in basic InputText examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IsItemDeactivatedAfterEdit doesn't play nicely with ConfigInputTextEnterKeepActive

2 participants