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

fix: Fix bug that prevented keyboard navigation in flyouts. #8687

Open
wants to merge 1 commit into
base: rc/v12.0.0
Choose a base branch
from

Conversation

gonfunko
Copy link
Contributor

@gonfunko gonfunko commented Dec 5, 2024

The basics

The details

This PR fixes an issue that caused findNextLocationInFlyout() to return invalid items. With the flyout changes in v12, spacers (and potentially custom user-defined items) are included in the list of flyout contents, but are not valid keyboard navigation locations. As such, simply taking the next/previous item relative to the current one is insufficient; that item may be inspected, but if it is of a non-navigable type, the subsequent item needs to be checked until a valid navigation location is found.

@gonfunko gonfunko requested a review from a team as a code owner December 5, 2024 20:58
@github-actions github-actions bot added the PR: fix Fixes a bug label Dec 5, 2024
resultIndex >= 0 &&
resultIndex < flyoutContents.length &&
!(
flyoutContents[resultIndex].element instanceof BlockSvg ||
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you file a bug to create an isNavigable API or similar for flyout items? This will do for now but eventually those custom items will need to be navigable (a text entry box for searching being the most obvious case).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is why I was asking about ASTNode in the chat :) I think we probably just want to add that method to IASTNodeLocation; should I just go ahead and do that in this PR?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think so; @cpcallen to confirm. This would be in the v12 beta so we'll still have time to change it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants