-
Notifications
You must be signed in to change notification settings - Fork 185
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(ModalPage, ModalCard): add prop disableFocusTrap
to fix conflict with several FocusTraps
#8248
fix(ModalPage, ModalCard): add prop disableFocusTrap
to fix conflict with several FocusTraps
#8248
Conversation
…ct with several FocusTraps
size-limit report 📦
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
e2e tests |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8248 +/- ##
=======================================
Coverage 95.53% 95.54%
=======================================
Files 404 404
Lines 11559 11559
Branches 3837 3837
=======================================
+ Hits 11043 11044 +1
+ Misses 516 515 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
👀 Docs deployed
Commit 9151df4 |
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.
Хорошо придумал! 👏
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.
💅
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.
🎉 👍
Единственно, теперь у нас две вариации свойств, которые что-то отключают: |
a079326
Действительно, лучше переименовать, чтобы потом потом не пришлось |
focusTrapDisabled
to fix conflict with several FocusTrapsdisableFocusTrap
to fix conflict with several FocusTraps
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.
💅
❌ PatchНе удалось автоматически применить исправление на ветке 7.1-stable.
Чтобы изменение попало в ветку 7.1-stable, выполните следующие действия:
git stash # опционально
git fetch origin 7.1-stable
git checkout -b patch/pr8248 origin/7.1-stable
git cherry-pick --no-commit 59c9515ab92faf34a54bdb141f1a0cb18baf755a
git checkout HEAD **/__image_snapshots__/*.png
git diff --quiet HEAD || git commit --no-verify --no-edit
git push --set-upstream origin patch/pr8248
gh pr create --base 7.1-stable --title "patch: pr8248" --body "- patch #8248" |
…ct with several FocusTraps (#8248) * fix(ModalPage, ModalCard): add prop `focusTrapDisabled` to fix conflict with several FocusTraps * doc(ModalPage,ModalCard): fix documentation * doc(ModalPage,ModalCard): fix docs * doc(ModalPage,ModalCard): fix docs * fix: rename `focusTrapDisabled` to `disableFocusTrap` # Conflicts: # packages/vkui/src/components/ModalCard/ModalCard.test.tsx # packages/vkui/src/components/ModalCard/ModalCardInternal.tsx # packages/vkui/src/components/ModalPage/ModalPage.test.tsx # packages/vkui/src/components/ModalPage/types.ts
…ct with several FocusTraps (#8248) (#8261) * fix(ModalPage, ModalCard): add prop `focusTrapDisabled` to fix conflict with several FocusTraps * doc(ModalPage,ModalCard): fix documentation * doc(ModalPage,ModalCard): fix docs * doc(ModalPage,ModalCard): fix docs * fix: rename `focusTrapDisabled` to `disableFocusTrap` # Conflicts: # packages/vkui/src/components/ModalCard/ModalCard.test.tsx # packages/vkui/src/components/ModalCard/ModalCardInternal.tsx # packages/vkui/src/components/ModalPage/ModalPage.test.tsx # packages/vkui/src/components/ModalPage/types.ts
FocusTrap
#8244Описание
Сейчас, когда поверх одной модалки открывается другая, получается что одновременно начинают работать два
FocusTrap
, которые начинают конфликтовать и работать некорректно. При нажатииTab
фокус перескакивает с одной модалки на другую. Нужно придумать, как решить эту проблемуИзменения
ModalPage
иModalCard
свойствоdisableFocusTrap
, которое позволяет отключать захват фокуса, когда, например, одна модалка перекрывается другойdisableFocusTrap
disableFocusTrap
Release notes
Улучшения
disableFocusTrap
для отключения захвата фокусаНужно для кейса, когда поверх одной модалки открывается другая, чтобы несколько
FocusTrap
не конфликтовали между собойdisableFocusTrap
для отключения захвата фокусаНужно для кейса, когда поверх одной модалки открывается другая, чтобы несколько
FocusTrap
не конфликтовали между собойИсправления
FocusTrap
-ов при нескольких открытых модалках