Skip to content

Commit

Permalink
[EuiResizableContainer] Initialize after DOM is ready (#4447)
Browse files Browse the repository at this point in the history
* init after dom ready

* revert me

* render check

* Revert "revert me"

This reverts commit f8c0fd9.

* CL
  • Loading branch information
thompsongl authored Jan 28, 2021
1 parent 1176832 commit 4d8afb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
**Bug fixes**

- Fixed heights of `append` and `prepend` in `EuiComboBox` ([#4410](https://github.com/elastic/eui/pull/4410))
- Fixed `EuiResizableContainer` initialization timing based on DOM readiness ([#4447](https://github.com/elastic/eui/pull/4447))

## [`31.3.0`](https://github.com/elastic/eui/tree/v31.3.0)

Expand Down
6 changes: 4 additions & 2 deletions src/components/resizable_container/resizable_container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ export const EuiResizableContainer: FunctionComponent<EuiResizableContainerProps
);

useEffect(() => {
initialize();
if (containerSize.width > 0 && containerSize.height > 0) {
initialize();
}
}, [initialize, containerSize]);

const onMouseDown = useCallback(
Expand Down Expand Up @@ -273,7 +275,7 @@ export const EuiResizableContainer: FunctionComponent<EuiResizableContainerProps
onTouchMove={onMouseMove}
onTouchEnd={onMouseUp}
{...rest}>
{!!reducerState.containerSize && render()}
{render()}
</div>
</EuiResizableContainerContextProvider>
);
Expand Down

0 comments on commit 4d8afb1

Please sign in to comment.