-
Notifications
You must be signed in to change notification settings - Fork 184
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(CustomSelect): Use onMouseOver
instead onMouseEnter
#2328
fix(CustomSelect): Use onMouseOver
instead onMouseEnter
#2328
Conversation
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. Latest deployment of this branch, based on commit 8f6e99e:
|
size-limit report 📦
|
👀 Styleguide deployedSee the styleguide for this PR at https://vkcom.github.io/VKUI/pull/2328/ |
Changed screenshotsCode coverage
|
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.
Ином, ты 🔥
afc0481
to
8ccd2d2
Compare
Компонент
CustomSelect
Какая была проблема?
При параметре
searchable
, обновляется "ребёнок", из-за чегоonMouseEnter
не срабатывает в следующих кейсах:Более подробно по ссылке facebook/react#13956 (comment)
Как починилось?
onMouseEnter
был заменён наonMouseOver
.onMouseOver
отличается тем, что он будет дополнительно вызываться, если мы указали на ребёнка элемента. Чтобы оптимизировать это, добавляем при проверку перед обновлением состояния в функцииfocusOptionByIndex()
компонентаVKUI/src/components/CustomSelect/CustomSelect.tsx
Lines 362 to 369 in afc0481