Fixes #5040. SelectorBase.TabBehavior setter calls CreateSubViews() without UpdateChecked(), desyncing CheckBox visual state#5044
Merged
tig merged 6 commits intogui-cs:developfrom Apr 22, 2026
Conversation
…ws() without UpdateChecked(), desyncing CheckBox visual state
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the selector visual-state desync reported in #5040 by ensuring checkbox checked state is synchronized after selector subviews are recreated.
Changes:
- Move “sync checked state” behavior to run after
CreateSubViews ()completes (instead of being manually invoked by several property setters). - Add logic in
OptionSelector.UpdateChecked ()to resetValuewhen it no longer matches any checkbox. - Add a new unit test covering
Valuereset whenValueschanges.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Terminal.Gui/Views/Selectors/SelectorBase.cs | Removes explicit UpdateChecked () calls from multiple setters and calls UpdateChecked () at the end of CreateSubViews (). |
| Terminal.Gui/Views/Selectors/OptionSelector.cs | Extends UpdateChecked () to potentially reset Value if it’s not represented by any checkbox. |
| Tests/UnitTestsParallelizable/Views/SelectorBaseTests.cs | Adds a test asserting Value resets when swapping Values to a set that doesn’t include the current value. |
rcdailey
approved these changes
Apr 22, 2026
Contributor
rcdailey
left a comment
There was a problem hiding this comment.
Looks great. Thank you for fixing this!
Collaborator
Author
|
@tig, sometimes the solution takes an immense amount of time to build, constantly processing the |
This was referenced Apr 30, 2026
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.
Fixes
Proposed Changes/Todos
Pull Request checklist:
CTRL-K-Dto automatically reformat your files before committing.dotnet testbefore commit///style comments)