From 72eca2a0730174796dac3e5f197985d8b2fba9ee Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Mon, 2 Mar 2020 07:59:31 -0500 Subject: [PATCH] Block Editor: Clear toolbar timeout by ref on unmount (#20546) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Block Editor: Clear toolbar timeout by ref on unmount * Add 2nd param to useEffect call Co-authored-by: Grzegorz (Greg) Ziółkowski --- packages/block-editor/src/components/block-toolbar/utils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/block-editor/src/components/block-toolbar/utils.js b/packages/block-editor/src/components/block-toolbar/utils.js index 7f7accf7c8784b..da64ca0bfb3488 100644 --- a/packages/block-editor/src/components/block-toolbar/utils.js +++ b/packages/block-editor/src/components/block-toolbar/utils.js @@ -59,6 +59,8 @@ export function useDebouncedShowMovers( { [ isFocused ] ); + useEffect( () => () => clearTimeout( timeoutRef.current ), [] ); + return { showMovers, debouncedShowMovers,