This repository was archived by the owner on Mar 4, 2020. It is now read-only.
fix(Popup): avoid double rendering#1153
Merged
layershifter merged 15 commits intomasterfrom May 9, 2019
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1153 +/- ##
==========================================
+ Coverage 72.24% 72.78% +0.53%
==========================================
Files 752 748 -4
Lines 5614 5665 +51
Branches 1671 1633 -38
==========================================
+ Hits 4056 4123 +67
+ Misses 1551 1535 -16
Partials 7 7
Continue to review full report at Codecov.
|
5 tasks
kuzhelov
reviewed
May 9, 2019
packages/react/src/components/Popup/createPopperReferenceProxy.ts
Outdated
Show resolved
Hide resolved
kuzhelov
reviewed
May 9, 2019
packages/react/src/components/Popup/createPopperReferenceProxy.ts
Outdated
Show resolved
Hide resolved
kuzhelov
reviewed
May 9, 2019
…p/poup # Conflicts: # CHANGELOG.md # packages/react/src/components/Popup/Popup.tsx
kuzhelov
reviewed
May 9, 2019
packages/react/src/components/Popup/createPopperReferenceProxy.ts
Outdated
Show resolved
Hide resolved
kuzhelov
approved these changes
May 9, 2019
kuzhelov
reviewed
May 9, 2019
…-ui/react into exp/poup # Conflicts: # CHANGELOG.md
bmdalex
pushed a commit
that referenced
this pull request
May 9, 2019
* Popup experiment * cleanup * more cleanups * rename file * add changelog entries * add "implements PopperJS.ReferenceObject" * replace `triggerDomElement` with `triggerRef.current` * update typings * rewrite to WeakMap * update comment * remove memoization
5 tasks
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
BREAKING CHANGES
defaultTargetprop is removed onPopupcomponent, please use directlytargetprop.Goal
This PR backports changes from SUIR. It allows us to avoid double rendering of
Popupbecause we don't storetargetin state anymore.targetis no longer autocontrolled prop because we don't need in component's state.It uses an idea with
VirtualReferencefromreact-popper, so we can can usecreateRef()API from React and avoid double rendering as we don't need to storetargetin components state more.Additional: fix Dropdown items' positioning
Also, these changes are needed for #1312 : to render dropdown items in the correct area based on align and placement props and Popper integration
What
trueon aDropdown, then PopperJS does not render the items on first renderNote on alternative solution
The alternative would be to introduce logic to render the
Dropdownitems only when theDropdownopen flag istrue; but this breaks accessibility concerns, as the list ofDropdownitems always needs to be open