Fix caret behavior on input field activation#2850
Open
pvcraven wants to merge 1 commit intodevelopmentfrom
Open
Fix caret behavior on input field activation#2850pvcraven wants to merge 1 commit intodevelopmentfrom
pvcraven wants to merge 1 commit intodevelopmentfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fix UIInputText caret not activating when switching between input fields.
Description
_on_active_changedonly handled deactivation (_active→False), ignoring activation (_active→True). This meantcaret.on_activate()was never called through the Property callback path.The normal activation path is: click →
on_click→activate(). ButUIInteractiveWidget.on_eventcalls_grap_active()on mouse press, settingwidget._active = Truebeforeon_clickfires on mouse release. Whenactivate()runs, itsif self._active: returnguard bails out immediately —caret.on_activate()is never reached.The caret appears to work on first use because pyglet's
Caretconstructor defaults_active = True. After the firstdeactivate()setscaret._active = False, no code path restores it.The fix adds the activation case to
_on_active_changed, so the caret is properly activated whenever the widget's_activeproperty becomesTrue, regardless of whether it was set byactivate()or_grap_active().Test plan
UIInputTextwidgets on screen