You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: No reliable way to make ion-button programatically focusable #29830
This have been asked before, but it seems the workaround provided here will clash with the internal button tag inside the component and makes button require two tab presses to move their focus to the next element.
this in my humble opinion looks like an A11Y issue as we're nesting interactive elements.
Expected Behavior
adding tabindex="0" should allow element to be programatically focusable but not make it to require 2 tabs to be jumped over
Thank you for the issue! I agree that adding tabindex="0" may not provide the best user experience, as it requires users to tab twice to achieve focus. If you're using an ion-app, the following should work to focus a button element:
I've raised this with the team to explore a better solution for using the native focus() with the button. I'll update this issue once we've decided on the best approach. 🙂
I spoke with the team and we decided to document the above usage. I've created an issue for this here: ionic-team/ionic-docs#3815. Let me know if there are any issues with this. Thank you!
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Activity
brandyscarney commentedon Sep 4, 2024
Thank you for the issue! I agree that adding
tabindex="0"may not provide the best user experience, as it requires users to tab twice to achieve focus. If you're using anion-app, the following should work to focus a button element:You can view a working example on CodePen: https://codepen.io/brandyscarney/pen/gONQvpX?editors=1010
I've raised this with the team to explore a better solution for using the native
focus()with the button. I'll update this issue once we've decided on the best approach. 🙂brandyscarney commentedon Sep 5, 2024
I spoke with the team and we decided to document the above usage. I've created an issue for this here: ionic-team/ionic-docs#3815. Let me know if there are any issues with this. Thank you!
docs(app): add setFocus to the documentation (#29916)
ionitron-bot commentedon Oct 31, 2024
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.