diff --git a/src/Playroom/Toolbar/Toolbar.tsx b/src/Playroom/Toolbar/Toolbar.tsx index 801d3acd..1fd1e1a9 100644 --- a/src/Playroom/Toolbar/Toolbar.tsx +++ b/src/Playroom/Toolbar/Toolbar.tsx @@ -1,4 +1,4 @@ -import { useContext, useState, useCallback, useEffect } from 'react'; +import { useRef, useContext, useState, useCallback, useEffect } from 'react'; import { useTimeoutFn } from 'react-use'; import classnames from 'classnames'; import type { PlayroomProps } from '../Playroom'; @@ -40,6 +40,7 @@ export default ({ themes: allThemes, widths: allWidths, snippets }: Props) => { ] = useContext(StoreContext); const [copying, setCopying] = useState(false); const [isReady, cancel, reset] = useTimeoutFn(() => setCopying(false), 3000); + const nodeRef = useRef(null); const copyHandler = useCallback(() => { dispatch({ @@ -157,13 +158,14 @@ export default ({ themes: allThemes, widths: allWidths, snippets }: Props) => { setLastActivePanel(undefined)} > -
+
{lastActivePanel === 'snippets' && (