I am currently working on a Vue 3 autocomplete component and I've come across a strange issue that I can't quite figure out.
The component emits two events: "update:search" to update the search variable in the parent component, and "change" which passes the user's input as a parameter. Both events are triggered on "keyup".
In the parent component, I have set up a listener for the "change" event from the autocomplete, which then triggers a search function. Initially, everything seems to be functioning correctly. However, sometimes when making an API call, the input string is not synchronized with what is retrieved in the search function.
Here is a visual representation of the problem when trying to type "hello world":
https://i.sstatic.net/cEZKg.gif
After observing the behavior, it seems like the issue arises when modifying a property of the autocomplete component from the parent. If I modify a variable not used in the Autocomplete component, there are no issues.
You can reproduce the problem by visiting this link: https://stackblitz.com/edit/vuepic-vue-datepicker-udxicv?file=README.md
Any insights or ideas on what might be causing this inconsistency would be greatly appreciated. Thank you for your assistance.