Skip to content

Commit

Permalink
fix(combobox): autocomplete not working in vue version (#993)
Browse files Browse the repository at this point in the history
  • Loading branch information
niksy authored Nov 6, 2023
1 parent 2756577 commit d827002
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/ten-candles-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zag-js/combobox": patch
---

Fix autocomplete input behavior not working in Vue version
4 changes: 3 additions & 1 deletion packages/machines/combobox/src/combobox.machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,9 @@ export function machine<T extends CollectionItem>(userContext: UserDefinedContex
const inputEl = dom.getInputEl(ctx)
if (!ctx.autoComplete || !inputEl || !KEYDOWN_EVENT_REGEX.test(evt.type)) return
const valueText = ctx.collection.valueToString(ctx.highlightedValue)
inputEl.value = valueText || ctx.inputValue
raf(() => {
inputEl.value = valueText || ctx.inputValue
})
},
setCollection(ctx, evt) {
ctx.collection = evt.value
Expand Down

4 comments on commit d827002

@vercel
Copy link

@vercel vercel bot commented on d827002 Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zag-nextjs – ./examples/next-ts

zag-nextjs-chakra-ui.vercel.app
zag-nextjs-git-main-chakra-ui.vercel.app
zag-two.vercel.app

@vercel
Copy link

@vercel vercel bot commented on d827002 Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on d827002 Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zag-solid – ./examples/solid-ts

zag-solid-git-main-chakra-ui.vercel.app
zag-solid.vercel.app
zag-solid-chakra-ui.vercel.app

@vercel
Copy link

@vercel vercel bot commented on d827002 Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zag-vue – ./examples/vue-ts

zag-vue-chakra-ui.vercel.app
zag-vue.vercel.app
zag-vue-git-main-chakra-ui.vercel.app

Please sign in to comment.