-
Notifications
You must be signed in to change notification settings - Fork 434
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: prevent scroll to top on modal close #1313
fix: prevent scroll to top on modal close #1313
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/components/common/Modal.tsx
Outdated
@@ -12,7 +12,7 @@ const Modal = ({ children, ...rest }: ModalProps): JSX.Element => { | |||
const transition = useBreakpointValue<any>(transitionValues) | |||
|
|||
return ( | |||
<ChakraModal motionPreset={transition} {...rest}> | |||
<ChakraModal motionPreset={transition} returnFocusOnClose={false} {...rest}> |
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.
Hmm, this will disable this accessibility feature for all modals, I think we shouldn't do that. ;)
So the root of the issue is that when we close the modal, the focus returns to the NavMenu
. That's incorrect, the focus should just return to the menu item which opens the modal, so could you please just fix the focus management in the edit reward modals? I think you should use the Modal
component's finalFocusRef
to achieve this behaviour, but not sure if it works with modals inside menus, so we might need to find a workaround for that :S
Love the work done so far... You're doing well |
Stale PR, closing since we are in process of replacing Chakra UI. |
No description provided.