-
Notifications
You must be signed in to change notification settings - Fork 185
fix(ChipsSelect): fix closing dropdown when placement change #8454
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(ChipsSelect): fix closing dropdown when placement change #8454
Conversation
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
|
👀 Docs deployed
Commit 941f9b6 |
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.
А не исследовал почему там onMouseDown
, а не onClick
? Нельзя ли конкретно логику добавления на click
повесить?
Я руководствовался тем, что обычно |
❌ PatchНе удалось автоматически применить исправление на ветке 7.2-stable.
Чтобы изменение попало в ветку 7.2-stable, выполните следующие действия:
git stash # опционально
git fetch origin 7.2-stable
git checkout -b patch/pr8454 origin/7.2-stable
git cherry-pick --no-commit de56b37d582585cdfaae0266d52934a9bace07e4
git checkout HEAD **/__image_snapshots__/*.png
git diff --quiet HEAD || git commit --no-verify --no-edit
git push --set-upstream origin patch/pr8454
gh pr create --base 7.2-stable --title "patch: pr8454" --body "- patch #8454" |
Описание
Если ChipsSelect близко к нижнему краю страницы, то как только выбирается итем, который переносит контент на следующую строку и сдвигает всплывающую область вниз, всплывающая область пытается отразиться наверх, на пол секунды у неё получается, но потом она просто закрывается. Тот же баг есть, если наверху не хватает места, и он пытается отражаться вниз.
Поисследовал проблему, оказалось, что:
onClick
, который уже срабатывает за пределами дропдаунаИзменения
Добавил флаг
forbidCloseByOutsideClick
, который устанавливается вtrue
приmousedown
на опцию, и запрещает закрывать дропдаун по событиюclick
за пределами. Когда срабатывает обработчикclick
за пределами флаг сбрасывается вfalse
. В результате дропдаун не закрываетсяRelease notes
Исправления