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

🎹 Improve keyboard accessibility #481

Merged
merged 1 commit into from
Sep 30, 2024
Merged

🎹 Improve keyboard accessibility #481

merged 1 commit into from
Sep 30, 2024

Conversation

rowanc1
Copy link
Collaborator

@rowanc1 rowanc1 commented Sep 27, 2024

This changes the focus to the element, rather than just scrolling to it.

Copy link

changeset-bot bot commented Sep 27, 2024

🦋 Changeset detected

Latest commit: 6a9e28e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@myst-theme/site Patch
@myst-theme/providers Patch
@myst-theme/frontmatter Patch
@myst-theme/diagrams Patch
@myst-theme/jupyter Patch
@myst-theme/styles Patch
@myst-theme/common Patch
@myst-theme/icons Patch
@myst-theme/search Patch
@myst-theme/search-minisearch Patch
@myst-theme/book Patch
@myst-theme/article Patch
myst-to-react Patch
myst-demo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

if (!el) return;

el.scrollIntoView({ behavior: 'smooth' });
history.replaceState(undefined, '', `#${heading.id}`);
// Changes keyboard tab-index location
if (el.tabIndex === -1) el.tabIndex = -1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

@rowanc1 did you want to change the tab index?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This actually does, -1 is the get default, but it isn't actually set. When you set it to -1 that actually changes the behaviour in the browser!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, I see!

@rowanc1 rowanc1 merged commit d175a30 into main Sep 30, 2024
2 checks passed
@rowanc1 rowanc1 deleted the feat/focus branch September 30, 2024 18:20
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