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

Add order functionality for anchors buttons #69

Merged
merged 8 commits into from
Jan 11, 2024

Conversation

KaliedaRik
Copy link
Owner

Issue

We need to find a way to allow anchors and buttons to have their tab ordering set dynamically.

  • We cannot use the tabindex attribute on the hidden <a> and <button> elements as we have no way of knowing how such changes would interfere with the tab ordering in the web page beyond the canvas element.
  • So we make a guarantee to devs that all hidden <a> and <button> elements associated with the canvas will always have a tabindex value of 0.
  • Instead, we can add an order attribute to the SC Anchor and Button objects. Then, when objects are added/removed, or the order value of existing object changes, we can rebuild the Canvas wrapper's hidden <nav> element so that the elements are listed in the correct tabbing order.

@KaliedaRik
Copy link
Owner Author

We can also make a case for 'disabling' a link. Example use case: the entity defining the link gets hidden or moved out of view, in which case the <a> link should also disappear for users who choose to navigate via keyboard tabbing.

  • Doable by adding a disabled attribute to the Anchor object - when true, the <a> element is removed from the hidden <nav> element; when false, it gets added back in.

@KaliedaRik KaliedaRik marked this pull request as ready for review January 11, 2024 12:52
@KaliedaRik KaliedaRik merged commit da2d5f5 into v8-dev Jan 11, 2024
@KaliedaRik KaliedaRik deleted the add-order-functionality-for-anchors-buttons branch January 11, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant