From 9a770f2924dd6fea2977214b4489d247241779a6 Mon Sep 17 00:00:00 2001 From: Christian Hausknecht Date: Mon, 18 Nov 2024 15:22:42 +0100 Subject: [PATCH] Fix setting an initial value for the ComboBox (#921) Co-authored-by: christian.hausknecht (cherry picked from commit eaff40fea1c65c940c90de13df22c9163b101c8b) --- .../jsMain/kotlin/dev/fritz2/headless/components/combobox.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headless/src/jsMain/kotlin/dev/fritz2/headless/components/combobox.kt b/headless/src/jsMain/kotlin/dev/fritz2/headless/components/combobox.kt index f7d497424..609f20c87 100644 --- a/headless/src/jsMain/kotlin/dev/fritz2/headless/components/combobox.kt +++ b/headless/src/jsMain/kotlin/dev/fritz2/headless/components/combobox.kt @@ -634,7 +634,7 @@ class Combobox(tag: Tag, id: String?) : Tag by tag, Op value( merge( internalState.selections.map { format(it) }, - internalState.data.map { it.lastSelection }.distinctUntilChanged().flatMapLatest { value -> + internalState.data.drop(1).map { it.lastSelection }.distinctUntilChanged().flatMapLatest { value -> internalState.resetQuery.transform { // Before the input's value can be reset to the previous one we need to set it to // the current typed value. This is needed because the underlying `mountSimple` function