From d6024dcd64da636c7010ec2bba6e2e50970ae4ed Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Fri, 28 Feb 2020 16:55:53 -0500 Subject: [PATCH] Block Editor: Clear toolbar timeout by ref on unmount --- 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 7f7accf7c8784..de44e2d69641b 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,