formkit icon indicating copy to clipboard operation
formkit copied to clipboard

FormKit Pro(Autocomplete): Incorrect tabindex when disabled automatically

Open daniil4udo opened this issue 4 months ago • 0 comments

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:

  1. Set the autocomplete input with an empty options array ([]).
  2. Try tabbing through the page.

Environment

• OS: macOS • Browser Safari

daniil4udo avatar Oct 11 '24 08:10 daniil4udo