Skip to content

Conversation

ClearlyClaire
Copy link
Contributor

Fixes #31880

We used to autofocus the primary button in modals, but that changed with #29576.

As far as I can gather, focusing the primary button of a modal is good practice, but that may not be completely clear cut.

@ClearlyClaire
Copy link
Contributor Author

ClearlyClaire commented Sep 12, 2024

This triggers jsx-a11y/no-autofocus on the Typescript file, but that rule is disabled in .eslintrc.js for JSX files. I'm not too sure why different rules are applied for Typescript.

EDIT: tt turns out the .eslintrc.js file re-imports plugin:jsx-a11y/recommended in an override for Typescript files. I decided to be explicit about the exception in the file itself rather than disabling the rule globally.

@ClearlyClaire ClearlyClaire added the area/web interface Related to the Mastodon web interface label Sep 12, 2024
@ClearlyClaire ClearlyClaire requested a review from a team September 12, 2024 13:06
@ClearlyClaire ClearlyClaire marked this pull request as ready for review September 12, 2024 13:06
@ClearlyClaire ClearlyClaire added this pull request to the merge queue Sep 12, 2024
Merged via the queue into main with commit 5f782f9 Sep 12, 2024
34 checks passed
@ClearlyClaire ClearlyClaire deleted the fixes/modal-autofocus branch September 12, 2024 13:25
justinwritescode pushed a commit to justinwritescode/mastodon that referenced this pull request Sep 15, 2024
nileane pushed a commit to nileane/mastodon that referenced this pull request Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/web interface Related to the Mastodon web interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default focus on modal dialogs
2 participants