@samitouri / QOS-React-2 / commits / 96dc003a70

Removed debounce+animation from indentation adjustment

Brian Vaughn committed Jun 1, 2019 at 17:48 UTC 96dc003a708a0d4a7b7959fb0e07ef87067a257d
2 files changed +1 -15
src/devtools/views/Components/Element.js
-3
@@ -121,9 +121,6 @@ export default function ElementView({ data, index, style }: Props) {
121 // Left padding presents the appearance of a nested tree structure.
122 // We must use padding rather than margin/left because of the selected background color.
123 paddingLeft: `calc(${depth} * var(--indentation-size))`,
124 -
125 - // Animate horizontal axis compression so it's smoother.
126 - transition: 'padding-left 150ms',
124 }}
125 data-depth={depth}
126 >
src/devtools/views/Components/Tree.js
+1 -12
@@ -322,14 +322,6 @@ export default function Tree(props: Props) {
322 );
323 }
324
325 -let debounceTimeoutID: TimeoutID | null = null;
326 -function debounce(callback: () => void, delay: number) {
327 - if (debounceTimeoutID !== null) {
328 - clearTimeout(debounceTimeoutID);
329 - }
330 - debounceTimeoutID = setTimeout(callback, delay);
331 -}
332 -
325 function updateIndentationSizeVar(
326 innerDiv: HTMLDivElement,
327 indentationSizeRef: {| current: number |},
@@ -371,10 +363,7 @@ function updateIndentationSizeVar(
363
364 indentationSizeRef.current = indentationSize;
365
374 - // Debounce so newly added rows animate with pre-existing ones
375 - debounce(() => {
376 - list.style.setProperty('--indentation-size', `${indentationSize}px`);
377 - }, 50);
366 + list.style.setProperty('--indentation-size', `${indentationSize}px`);
367 }
368
369 function InnerElementType({ children, style, ...rest }) {