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: focus on last active element when dialog closes #3447

Merged
merged 2 commits into from Apr 15, 2021
Merged

Conversation

ad1992
Copy link
Member

@ad1992 ad1992 commented Apr 14, 2021

No description provided.

@vercel
Copy link

vercel bot commented Apr 14, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/excalidraw/excalidraw/8h7YBEHbhi82Z4f7Pv33FhUYJs4z
✅ Preview: https://excalidraw-git-aakansha-active-excalidraw.vercel.app

@ad1992 ad1992 requested a review from dwelle April 14, 2021 15:57
src/components/Dialog.tsx Outdated Show resolved Hide resolved
Comment on lines +23 to +24
// TODO: Fix the A11y issues so this is never needed since we should always focus on last active element
excalidrawContainer?.focus();
Copy link
Member

Choose a reason for hiding this comment

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

what do you refer to?

Copy link
Member Author

@ad1992 ad1992 Apr 15, 2021

Choose a reason for hiding this comment

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

Since we are now restoring focus to last active element so that should always take care of restoring focus to correct element, this is just an exception for one of the cases for example the when loading library if there is an error library pop up is closed when error dialog closes so thats why we have to focus the container but ideally we shouldn't close the pop up and restore the focus to the load button and also add esc to allow keyboard users to close the popup. Once thats done and any such other cases are fixed we can remove this.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, makes sense.

@ad1992 ad1992 merged commit c004726 into master Apr 15, 2021
@ad1992 ad1992 deleted the aakansha-active branch April 15, 2021 14:59
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

2 participants