Repository navigation
Fix TUI paste into TextArea and stale input state - #31
Merged
Merged
Conversation
- A bracketed paste into a focused TextArea was dropped: the key's String() is "[text]", which the single-rune branch ignored. Any rune key now inserts its runes; alt chords still do not. - Input and text-area editing state was never evicted, so state for generated per-row IDs accumulated, and an uncontrolled input hidden for a frame came back with its old text. Render now drops the state of controls it did not draw. Closes #28
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
Fixes #28, from the TUI audit.
KeyRunesmessage whoseString()is"[text]", and the TextArea only accepted single-rune keys. Any rune key now inserts its runes. Alt chords still don't insert.r.inputsandr.areaswere never pruned. State for generated per-row IDs grew forever, and an uncontrolled input hidden for one frame came back with its old typed text.Rendernow records which inputs and text areas it drew and drops the rest, so a returning control starts from its spec value like a newly mounted one.Test plan
TestPasteIntoTextArea: a pasted string reaches OnChange, and alt+x inserts nothing. It fails on main ("paste produced ").TestInputStateIsDroppedWhenTheControlLeaves: state is gone after a frame without the controls, and their old text doesn't come back. It fails on main ("1 inputs, 1 areas").go test -race ./...,make e2e