From 96dc003a708a0d4a7b7959fb0e07ef87067a257d Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Sat, 1 Jun 2019 17:48:01 -0700 Subject: [PATCH] Removed debounce+animation from indentation adjustment --- src/devtools/views/Components/Element.js | 3 --- src/devtools/views/Components/Tree.js | 13 +------------ 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/devtools/views/Components/Element.js b/src/devtools/views/Components/Element.js index d0c3fe8184..d0afe8d45c 100644 --- a/src/devtools/views/Components/Element.js +++ b/src/devtools/views/Components/Element.js @@ -121,9 +121,6 @@ export default function ElementView({ data, index, style }: Props) { // Left padding presents the appearance of a nested tree structure. // We must use padding rather than margin/left because of the selected background color. paddingLeft: `calc(${depth} * var(--indentation-size))`, - - // Animate horizontal axis compression so it's smoother. - transition: 'padding-left 150ms', }} data-depth={depth} > diff --git a/src/devtools/views/Components/Tree.js b/src/devtools/views/Components/Tree.js index b06538e04e..730570c714 100644 --- a/src/devtools/views/Components/Tree.js +++ b/src/devtools/views/Components/Tree.js @@ -322,14 +322,6 @@ export default function Tree(props: Props) { ); } -let debounceTimeoutID: TimeoutID | null = null; -function debounce(callback: () => void, delay: number) { - if (debounceTimeoutID !== null) { - clearTimeout(debounceTimeoutID); - } - debounceTimeoutID = setTimeout(callback, delay); -} - function updateIndentationSizeVar( innerDiv: HTMLDivElement, indentationSizeRef: {| current: number |}, @@ -371,10 +363,7 @@ function updateIndentationSizeVar( indentationSizeRef.current = indentationSize; - // Debounce so newly added rows animate with pre-existing ones - debounce(() => { - list.style.setProperty('--indentation-size', `${indentationSize}px`); - }, 50); + list.style.setProperty('--indentation-size', `${indentationSize}px`); } function InnerElementType({ children, style, ...rest }) {