-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUGFIX: Render dropdown contents even when dropdown is closed
Until now, dropdown contents were `null`ed when the dropdown is closed. This leads to unneccessary re-renders every time the dropdown visibility is toggled. This commit changes this logic. Dropdown contents are now always rendered, but hidden when the dropdown is closed.
- Loading branch information
Showing
3 changed files
with
33 additions
and
21 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
packages/react-ui-components/src/DropDown/__snapshots__/contents.spec.tsx.snap
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<ShallowDropDownContents/> should not render when having no children. 1`] = ` | ||
<ul | ||
aria-hidden="true" | ||
aria-label="dropdown" | ||
className="baseDropDownContentsClassName" | ||
data-ignore_click_outside={true} | ||
onClick={[MockFunction]} | ||
role="listbox" | ||
style={Object {}} | ||
> | ||
Foo children | ||
</ul> | ||
`; |
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
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