From edc598e62a97b4858ecbc8cf4e2b72add8e366fb Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Tue, 9 Apr 2019 11:43:49 -0700 Subject: [PATCH] Fixed Tree minWidth initial case to fill 100% width --- src/devtools/views/Components/Tree.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/devtools/views/Components/Tree.js b/src/devtools/views/Components/Tree.js index 5bb94c77f7..b97ff5a9cf 100644 --- a/src/devtools/views/Components/Tree.js +++ b/src/devtools/views/Components/Tree.js @@ -198,12 +198,15 @@ function InnerElementType({ style, ...rest }) { // We shouldn't retain this width across different conceptual trees though, // so when the user opens the "owners tree" view, we should discard the previous width. const divRef = useRef(null); - const minWidthRef = useRef(parseInt(style.width, 10)); - const minWidth = ownerStack.length > 0 ? '100%' : minWidthRef.current; + const minWidthRef = useRef(null); + const minWidth = + ownerStack.length > 0 || minWidthRef.current === null + ? '100%' + : minWidthRef.current; useEffect(() => { if (divRef.current !== null) { minWidthRef.current = Math.max( - minWidthRef.current, + minWidthRef.current || 0, divRef.current.offsetWidth ); }