[JEWEL-1244] Fix ListComboBox External SelectedIndex Changes Not Syncing To Internal State#3418
Open
DanielSouzaBertoldi wants to merge 1 commit intoJetBrains:masterfrom
Open
Conversation
209931a to
e8df948
Compare
| } | ||
|
|
||
| LaunchedEffect(itemKeys, selectedIndex, popupManager.isPopupVisible.value) { | ||
| if (!popupManager.isPopupVisible.value) { |
Collaborator
Author
There was a problem hiding this comment.
We really don't want to mess with the popup while its visible and the user is actively using it. This prevents any changes made programmatically from happening during this state.
daaria-s
approved these changes
Feb 13, 2026
rock3r
suggested changes
Mar 16, 2026
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/ListComboBox.kt
Show resolved
Hide resolved
platform/jewel/ui-tests/src/test/kotlin/org/jetbrains/jewel/ui/component/ListComboBoxUiTest.kt
Show resolved
Hide resolved
e8df948 to
f1bf453
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/ListComboBox.kt
Show resolved
Hide resolved
…ing to internal state
f1bf453 to
8f5a58d
Compare
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.

Context
Currently, our Combo Box implementation only updates its selected index internally. This means that, if users want to programmatically change it, the change won't be respected by our Combo Box. If the user clicks on a ComboBox, it'll show the value of whatever the user chose previously as the current selected item, not the item that was set by the code.
Changes
selectedIndexto ourLaunchedEffectin ComboBoxImpl, so that we can update the list state with the current selected indexIf you'd like to test this yourself, apply the git patch below:
Details
Evidences
Screen.Recording.2026-02-10.at.16.47.24.mov
Screen.Recording.2026-02-10.at.16.43.26.mov
Screen.Recording.2026-02-10.at.16.47.54.mov
Screen.Recording.2026-02-10.at.16.43.54.mov
Note
Medium Risk
Changes selection synchronization and popup-visible behavior in core UI components, which could subtly affect keyboard/mouse selection and commit-on-close flows, but is covered by new UI tests.
Overview
Ensures
ListComboBoxandEditableListComboBoxcorrectly reflect programmatic (selectedIndex) changes by syncingselectedIndexinto the internalSelectableLazyListStateonly when the popup is closed, avoiding selection jumps while users are navigating an open popup.Adds regression UI tests covering external
selectedIndexresets for both combo box variants, validating correct selection highlighting and non-disruption while the popup is visible.Written by Cursor Bugbot for commit 8f5a58d. This will update automatically on new commits. Configure here.