-
Notifications
You must be signed in to change notification settings - Fork 131
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 Hint or Tooltip with trigger='hover' over ComboBox/Select #1177
Merged
Conversation
This file contains 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
- faster startup - no duplicate mocks warning - removed obsolete padRight from InputLikeText
- removed unit test as 'simulate doesn’t actually simulate anything'; - added screenshot tests for both <Button/> and <input/> cases.
- merged test-setup & test-setup-framework into one file
wKich
requested changes
Feb 20, 2019
packages/retail-ui/components/Popup/__stories__/Popup.stories.tsx
Outdated
Show resolved
Hide resolved
packages/retail-ui/components/Popup/__stories__/Popup.stories.tsx
Outdated
Show resolved
Hide resolved
packages/retail-ui/components/Tooltip/__tests__/Tooltip-test.tsx
Outdated
Show resolved
Hide resolved
packages/retail-ui/components/Tooltip/__tests__/Tooltip-test.tsx
Outdated
Show resolved
Hide resolved
packages/retail-ui/components/Tooltip/__stories__/Tooltip.stories.tsx
Outdated
Show resolved
Hide resolved
wKich
reviewed
Feb 21, 2019
wKich
previously approved these changes
Feb 21, 2019
wKich
approved these changes
Feb 23, 2019
This was referenced Mar 7, 2019
5 tasks
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.
Fixes #898, fixes #646.
Суть фикса: в случае использования
React.createPortal
(react@^16) дети поратла ведут себя так, словно являются дочерними элементами своего родителя (хотя по факту это не так - они выносятся в body), и react'овские события mouseEnter/mouseLeave не вызываются; решение заключается в том, чтобы использовать честные события браузера.Что сделано:
useWrapper=true
) перенесена из Hint/Tooltip в Popup;anchorElement
в одном месте (updateAnchorElement()
) черезaddEventListener()
; focus/blur заменены на focusin/focusout (т.к. react'овские focus/blur, в отличие от настоящих, умели всплывать);anchorElement
наcomponentWillUnmount()
;getProps()
Tooltip'а больше не возвращаетwrapperProps
(за ненадобностью);Сайд эффекты:
this.refWrapper
за ненадобностью, вместе с ним -forceUpdate()
вcomponentDidMonut()
; для проверки работоспособности появилась Tooltip story 'ManualTooltip';handleInputBlur()
проверкаthis.state.opened
заменена наthis.state.editing
- решили с @wKich , что так правильнее; с проверкойopened
не вызывалсяblur()
, если меню ComboBox'а не открыто;onFocus
(на самом деле, он не проходил бы сuseWrapper=false
); вместо него добавлен скриншотный тест; скриншотный тест заигнорен в FF, т.к. мы используем 47-ую версию, а поддержкуfocusin
/focusout
завезли только с 52-ой;blur
был честным (без simulate); у ComboBox появился публичный методblur()
.rt_RootId
иreact-root-container-id
теперь всегда равны1
, вне зависимости от того, в какой последовательности и какие тесты гоняются; раньше они портились, если сделать---updateSnapshot
с конкретным упавшим тестом.