fix(NcModal): prevent focus trap race condition #8093
fix(NcModal): prevent focus trap race condition #8093nikhil2297 wants to merge 4 commits intonextcloud-libraries:mainfrom
Conversation
Signed-off-by: nikhil2297 <nikhillohar2297@gmail.com>
susnux
left a comment
There was a problem hiding this comment.
Should we not also remove the onMounted(() => useFocusTrap()) ?
I added a null check in |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8093 +/- ##
==========================================
- Coverage 52.77% 52.77% -0.01%
==========================================
Files 103 103
Lines 3348 3350 +2
Branches 976 978 +2
==========================================
+ Hits 1767 1768 +1
- Misses 1333 1334 +1
Partials 248 248 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Well its a useless function call as it will always fail 😉 But anyway: Can you please fix the failing linter? |
1410b80 to
bfeeeab
Compare
Signed-off-by: nikhil2297 <nikhillohar2297@gmail.com>
bfeeeab to
ba1d1d2
Compare
Perfect, I've fixed the linter part and did the |
susnux
left a comment
There was a problem hiding this comment.
Still think that the known-to-fail onMounted call should be removed but the fix itself seems to work fine!
Antreesy
left a comment
There was a problem hiding this comment.
Otherwise good. Although I'm also not seeing a point in keeping onMounted hook
…available Signed-off-by: nikhil2297 <nikhillohar2297@gmail.com>
|
This change doesn’t skip focus trap initialization if maskElement isn’t available it defers it until the element is present. Changes:
|
|
Would this fix #7946? |
useFocusTrap:fallbackFocuswas specified but was not a node, or did not return a node #8090☑️ Resolves
fallbackFocuserror occurs whenonMountedcallsuseFocusTrap()before template refs are readyuseFocusTrap:fallbackFocuswas specified but was not a node, or did not return a node #8090🖼️ Screenshots
fallbackFocus was specified but was not a nodeoccurring ~30% of the time during modal mounting🚧 Tasks
useFocusTrap()to prevent race condition🏁 Checklist
stable8for maintained Vue 2 version or not applicable