-
Notifications
You must be signed in to change notification settings - Fork 3
Description
What component (if applicable)
- URL for category: https://tailwindcss.com/plus/ui-blocks/documentation/autocomplete
- Component name: Tailwind plus autocomplete
Describe the bug
I want to submit a form on change after the autocomplete is selected, but because the event is triggered twice (once on blur because you click away, and once on the input event triggered by Tailwind elements), it seems impossible to do so.
To Reproduce
Steps to reproduce the behavior:
- Add an onChange event to the input of the autocomplete
- Type something so the autocomplete menu expands
- Click an item in the autocomplete list
- See the change event is triggered twice
Expected behavior
You can't eliminate this behaviour, but I wondered if there could be specific tailwind element events you could listen on, or a way to distinguish the change event from tailwind with the change event from the input itself.
Browser/Device (if applicable)
- OS: macOS
- Browser chrome & safari
Additional context
I couldn't find anything in the documentation about events except for the 'elements:ready' event. So I don't know what the stance is on events. But it seems like it would be make the elements more flexible if their would be more events or if there would be more info in the events.