Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The country flag receives focus before the input when allowDropdown is false #1692

Closed
ehynds opened this issue Jul 9, 2024 · 1 comment · Fixed by #1695
Closed

The country flag receives focus before the input when allowDropdown is false #1692

ehynds opened this issue Jul 9, 2024 · 1 comment · Fixed by #1695

Comments

@ehynds
Copy link
Contributor

ehynds commented Jul 9, 2024

Plugin version

v23.1.1

Steps to reproduce

  1. Load your storybook for the allowDropdown: false option: https://intl-tel-input.com/storybook/?path=/docs/intltelinput--allowdropdown
  2. Attempt to tab into the input

Expected behaviour

Tabbing into the input focuses the input. The next tab moves focus to the next form control.

Actual behaviour

The flag container button receives focus before the input. I don't think the flag should be a button element at all when allowDropdown is false because the flag is not actionable. At the very least it should be a disabled button.

Initialisation options

intlTelInput(node, {
  dropdownContainer,
  allowDropdown: false,
  initialCountry: 'us',
  utilsScript: `https://cdn.jsdelivr.net/npm/[email protected]/build/js/utils.js`,
});
@jackocnr
Copy link
Owner

jackocnr commented Jul 9, 2024

Thanks for raising this. Yes I agree, when allowDropdown is false, the selected flag should not be a button element, and it should not get tab focus. I don't have time to implement this change myself right now, but would be open to a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants