mirror of
https://github.com/JetBrains/intellij-platform-plugin-template.git
synced 2026-01-20 15:49:23 +00:00
Properly notify parents when SearchBarWithAutoCompletion text field text is cleared
This commit is contained in:
parent
cb6c908769
commit
edb8fb0b28
@ -58,6 +58,10 @@ internal fun <T> SearchBarWithAutoCompletion(
|
||||
snapshotFlow { textFieldState.text.toString() }
|
||||
.distinctUntilChanged()
|
||||
.collect { searchTerm ->
|
||||
if (searchTerm.isEmpty()) {
|
||||
onClear()
|
||||
}
|
||||
|
||||
popupController.onQueryChanged(searchTerm)
|
||||
}
|
||||
}
|
||||
@ -81,7 +85,6 @@ internal fun <T> SearchBarWithAutoCompletion(
|
||||
trailingIcon = {
|
||||
if (!isInputFieldEmpty) {
|
||||
CloseIconButton {
|
||||
onClear()
|
||||
textFieldState.setTextAndPlaceCursorAtEnd("")
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user