-
Notifications
You must be signed in to change notification settings - Fork 176
fix: improve modal focus #2049
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: improve modal focus #2049
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets try to avoid onMount()
hooks along with document.querySelector
. Its gets very messy to maintain and isn't a good DX as well. See if the autofocus
on the Input
components itself work. If they don't we might need to raise a PR on Pink2 side.
Hey @ItzNotABug, |
src/routes/(console)/project-[region]-[project]/auth/createUser.svelte
Outdated
Show resolved
Hide resolved
src/routes/(console)/project-[region]-[project]/messaging/create-[type]/(type)/email.svelte
Show resolved
Hide resolved
src/lib/components/sidebar.svelte
Outdated
@@ -269,7 +269,9 @@ | |||
>Feedback | |||
</Button.Button> | |||
<svelte:fragment slot="other"> | |||
<MobileFeedbackModal /> | |||
{#if $isSmallViewport} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both these feedback and support sections are for mobile only right? instead of only using the small view port check on feedback, lets move the check on an upper level.
src/lib/components/sidebar.svelte
Outdated
{#if $isSmallViewport} | ||
<MobileFeedbackModal /> | ||
{/if} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above if the mobile only section applies here.
…error caught during check
What does this PR do?
Implements a dual focus strategy for modals using both
autofocus
attribute andonMount
focus handling. This ensures reliable input focus across different scenarios (initial load and dynamic content) and improves keyboard accessibility.Test Plan
Initial page load:
Dynamic content:
Browser testing:
Related PRs and Issues
Fixes #1882 - Modal focus not working consistently
Have you read the Contributing Guidelines on issues?
Yes