preline icon indicating copy to clipboard operation
preline copied to clipboard

Combobox will skip at least one item if arrowdown/up in vue3

Open APshZ opened this issue 1 year ago • 1 comments

Background

While using the example from https://preline.co/docs/combobox.html and put it under the vue component, find that after input value in the input field, the keydown event will trigger more than once from Argentina step to China instead of Brazil image The dropdown in example also have same issue for skipping items. https://stackblitz.com/edit/preline-v2-vue-and-vue-router?file=src%2Frouter%2Findex.ts,README.md

so i debug the prelinejs for combobox and find that every time route to the component which contains combobox, the autoinit function triggered and duplicate the combobox in window.$hsComboBoxCollection image which will lead to the more item count being skipped

Browser

Chrome, Edge

wait for fix or is it my code problem

APshZ avatar May 19 '24 08:05 APshZ

and my temp solution for vue <div class="relative" data-hs-combo-box="" @keydown.down.stop="combobox.onArrow(false)" @keydown.up.stop="combobox.onArrow(true)">

APshZ avatar May 19 '24 08:05 APshZ

Hey @APshZ - please check out the latest version, the issue has been fixed. Thanks!

jahaganiev avatar Sep 23 '24 21:09 jahaganiev