formkit
formkit copied to clipboard
FormKit Pro(Autocomplete): Incorrect tabindex when disabled automatically
Reproduction
https://formkit.link/942b80d29e03fd1c35e2db81479f452e
Describe the bug
When the autocomplete input is disabled, the tabindex should be set to -1 to prevent tabbing into the input field.
I’ve noticed that while inputs correctly handle the tabindex when disabled explicitly, the autocomplete input has a specific behavior (maybe other ones as well) where, if the options array is empty ([]), it automatically disables the input.
However, in this case, the tabindex is not updated, allowing users to still tab into the disabled input, leading to a confusing experience
Steps to reproduce:
- Set the autocomplete input with an empty options array ([]).
- Try tabbing through the page.
Environment
• OS: macOS • Browser Safari