From 2ebcf0b52457969fcd0716b4ea9d4be9bdd6afd9 Mon Sep 17 00:00:00 2001 From: bartbutenaers Date: Thu, 9 Jan 2025 20:54:35 +0100 Subject: [PATCH 1/2] ui-dropdown sync issue --- ui/src/widgets/ui-dropdown/UIDropdown.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ui/src/widgets/ui-dropdown/UIDropdown.vue b/ui/src/widgets/ui-dropdown/UIDropdown.vue index 8d98a815..e3445953 100644 --- a/ui/src/widgets/ui-dropdown/UIDropdown.vue +++ b/ui/src/widgets/ui-dropdown/UIDropdown.vue @@ -138,7 +138,11 @@ export default { onSync (msg) { // update the UI with any changes if (typeof msg?.payload !== 'undefined') { - this.value = msg.payload + if (this.typeIsComboBox) { + this.value = this.options.find((o) => o.value === msg.payload) + } else { + this.value = msg.payload + } } }, onChange () { @@ -187,7 +191,7 @@ export default { if (!Array.isArray(value)) { value = [value] } - + // value [] is used to clear the current selection if (value.length > 0) { // now if this is a single selection, we just need to find the option with the matching value @@ -206,7 +210,7 @@ export default { return } } - + // ensure we set our local "value" to match this.value = value } From db4f99c0a78ca6706307234af93c46d680430732 Mon Sep 17 00:00:00 2001 From: bartbutenaers Date: Thu, 9 Jan 2025 20:57:31 +0100 Subject: [PATCH 2/2] lint fixes --- ui/src/widgets/ui-dropdown/UIDropdown.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/widgets/ui-dropdown/UIDropdown.vue b/ui/src/widgets/ui-dropdown/UIDropdown.vue index e3445953..fc41b217 100644 --- a/ui/src/widgets/ui-dropdown/UIDropdown.vue +++ b/ui/src/widgets/ui-dropdown/UIDropdown.vue @@ -191,7 +191,7 @@ export default { if (!Array.isArray(value)) { value = [value] } - + // value [] is used to clear the current selection if (value.length > 0) { // now if this is a single selection, we just need to find the option with the matching value @@ -210,7 +210,7 @@ export default { return } } - + // ensure we set our local "value" to match this.value = value }