From 622abd9d808f2ccc96dc39e8af2c477e7c69f15b Mon Sep 17 00:00:00 2001 From: Ivan Morgillo Date: Fri, 21 Feb 2025 10:29:17 +0100 Subject: [PATCH] [jewel] JEWEL-773 fix EditableComboBox not closing popup on click reference https://youtrack.jetbrains.com/issue/JEWEL-773/EditableListComboBox-Clicking-an-item-does-not-close-the-popup closes JEWEL-773 closes https://github.com/JetBrains/intellij-community/pull/2952 (cherry picked from commit 8f91b6c9c3d120e38103e78ce6854e6ce2399a7a) IJ-MR-155570 GitOrigin-RevId: 1339d50e45323287a4423444deb70e9bb63683ce --- .../org/jetbrains/jewel/ui/component/EditableComboBox.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/EditableComboBox.kt b/platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/EditableComboBox.kt index 7b7e392df2c2..7838991bb124 100644 --- a/platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/EditableComboBox.kt +++ b/platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/EditableComboBox.kt @@ -18,6 +18,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.widthIn +import androidx.compose.foundation.onClick import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.BasicTextField import androidx.compose.foundation.text.input.TextFieldLineLimits @@ -193,8 +194,9 @@ public fun EditableComboBox( modifier = popupModifier .testTag("Jewel.ComboBox.Popup") - .semantics { contentDescription = "Jewel.ComboBox.Popup" } - .width(comboBoxWidth), + .semantics { contentDescription = "Jewel.EditableComboBox.Popup" } + .width(comboBoxWidth) + .onClick { popupManager.setPopupVisible(false) }, horizontalAlignment = Alignment.Start, popupProperties = PopupProperties(focusable = false), content = popupContent,