Replace focus-trap-vue with Vueuse implementation #1758
Replace focus-trap-vue with Vueuse implementation #1758
Conversation
Storybook and Tailwind configuration previews: Ready Storybook: https://wordpress.github.io/openverse-frontend/_preview/1758 Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again. You can check the GitHub pages deployment action list to see the current status of the deployments. |
Size Change: +983 B (0%) Total Size: 769 kB
ℹ️ View Unchanged
|
I'm going to close this issue because there's a type mismatch in the render function: |
Fixes
Fixes #1752 by @ramadanomar
Description
This PR copies VueUse integrations/useFocusTrap/component implementation to use the latest version of the upstream dependency,
focus-trap
.It is clear that
focus-trap-vue
is not going to update the Vue-2 branch to add the fix for the linked issue. I wanted to use theuseFocusTrap
component from VueUse at first, but I couldn't solve the Nuxt 2 import issue, so I vendored in the UseFocusTrap component. VueUse library is using MIT license, so it should be OK. Hopefully, after we move on to Vue 3, we can use the VueUse library instead of vendoring in the implementation.Testing Instructions
Run the app with
pnpm dev
, and on mobile screen, open the menu and filters modals. There should be no errors/warnings regarding the initial focus node in the console, and the focus should be handled correctly. When opening the modal, the first tabbable element should be focused. When you close the modal, you should be able to tab away from the modal trigger.Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin