feat: fix close floating elements and modals when esc keydown#9670
Open
EldarMuhamethanov wants to merge 6 commits intomasterfrom
Open
feat: fix close floating elements and modals when esc keydown#9670EldarMuhamethanov wants to merge 6 commits intomasterfrom
EldarMuhamethanov wants to merge 6 commits intomasterfrom
Conversation
fa405b7 to
3aff587
Compare
Contributor
size-limit report 📦
|
Contributor
e2e tests |
Contributor
👀 Docs deployed
📦 Package ✅yarn add @vkontakte/vkui@https://development.s3.prodcloud.vk.team/pull/9670/32a3953e0343e48a4b733d80545b66e64e24ac6c/pkg/@vkontakte/vkui/_pkg.tgzCommit 32a3953 |
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9670 +/- ##
=======================================
Coverage 95.35% 95.35%
=======================================
Files 439 439
Lines 12052 12053 +1
Branches 4374 4372 -2
=======================================
+ Hits 11492 11493 +1
Misses 560 560
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Описание
Раньше несколько слоёв (модальные окна, выпадающие списки, поповеры и т.п.) могли одновременно подписываться на закрытие по Escape, из-за чего одно нажатие закрывало сразу несколько уровней UI. В этой доработке вводится единый диспетчер на уровне документа: все активные обработчики Escape регистрируются в общий стек, и на одно нажатие обрабатывается только верхний (последний зарегистрированный) слой.
Закрытие модальных карточек/страниц по Escape переведено на тот же механизм, что и у остальных компонентов, чтобы поведение было согласованным. Для селектов и связанных контролов закрытие по Escape вынесено в глобальный слой (чтобы оно участвовало в общем порядке «снаружи внутрь»), убраны точечные
stopPropagation/localобходы, которые маскировали проблему.В общем теперь логика закрытия такая: кто последний открылся, то первый закроется при нажатии
ESCRelease notes
Исправления