Skip to content

Add limited support for focusgroup attribute #45

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

Closed
wants to merge 2 commits into from

Conversation

echo-vladimir
Copy link
Contributor

No description provided.

@@ -43,6 +54,10 @@ function getToolbarItems(group) {
}

function isHorizontalOrientation(group) {
let focusGroupValue = group.getAttribute('focusgroup')
if (focusGroupValue === 'inline') return true
if (focusGroupValue === 'block') return false
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is focusgroup has no inline or block? Some value should be by default?

Please, don’t rush. Read spec more careful and think twice and deeper.

if (group.role === 'toolbar') return getToolbarItems(group)
return group.querySelectorAll(`[role=${target.role}]`)
if (group.hasAttribute('focusgroup')) {
return [...group.children]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure, that all children should be focusable?

  1. What is some children is not focusable (like <h2>)?
  2. Can you double-check that we don't need similar logic to getToolbarItems?

@ai
Copy link
Owner

ai commented Oct 29, 2024

Sorry, this PR was faster #46

@ai ai closed this Oct 29, 2024
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.

2 participants