diff --git a/packages/ui/src/combobox.js b/packages/ui/src/combobox.js index 50739fcc8..65ce6d507 100644 --- a/packages/ui/src/combobox.js +++ b/packages/ui/src/combobox.js @@ -106,6 +106,9 @@ function handleRoot(el, Alpine) { // to settle up currently selected Values (this prevents this next bit // of code from running multiple times on startup...) queueMicrotask(() => { + // Set initial combobox values in the input... + queueMicrotask(() => this.__resetInput()) + Alpine.effect(() => { // Everytime the value changes, we need to re-render the hidden inputs, // if a user passed the "name" prop... diff --git a/tests/cypress/integration/plugins/ui/combobox.spec.js b/tests/cypress/integration/plugins/ui/combobox.spec.js index b3225dfba..049d74677 100644 --- a/tests/cypress/integration/plugins/ui/combobox.spec.js +++ b/tests/cypress/integration/plugins/ui/combobox.spec.js @@ -98,6 +98,68 @@ test('it works with x-model', }, ) +test('initial value is set from x-model', + [html` +