mirror of
https://github.com/JetBrains/intellij-platform-plugin-template.git
synced 2026-01-21 16:19:22 +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() }
|
snapshotFlow { textFieldState.text.toString() }
|
||||||
.distinctUntilChanged()
|
.distinctUntilChanged()
|
||||||
.collect { searchTerm ->
|
.collect { searchTerm ->
|
||||||
|
if (searchTerm.isEmpty()) {
|
||||||
|
onClear()
|
||||||
|
}
|
||||||
|
|
||||||
popupController.onQueryChanged(searchTerm)
|
popupController.onQueryChanged(searchTerm)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -81,7 +85,6 @@ internal fun <T> SearchBarWithAutoCompletion(
|
|||||||
trailingIcon = {
|
trailingIcon = {
|
||||||
if (!isInputFieldEmpty) {
|
if (!isInputFieldEmpty) {
|
||||||
CloseIconButton {
|
CloseIconButton {
|
||||||
onClear()
|
|
||||||
textFieldState.setTextAndPlaceCursorAtEnd("")
|
textFieldState.setTextAndPlaceCursorAtEnd("")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user