Skip to content

Commit

Permalink
Fix missing initial scrollIntoView, fix missing hooks dep breaking a …
Browse files Browse the repository at this point in the history
…setting
  • Loading branch information
Inwerpsel committed Oct 23, 2024
1 parent db9befd commit 02cf781
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 33 deletions.
56 changes: 28 additions & 28 deletions docs/demo/dist/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/demo/dist/bundle.js.map

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion docs/demo/dist/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/demo/dist/main.css.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/components/ResizableFrame.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { ACTIONS, editTheme } from '../hooks/useThemeEditor';

const wrapperMargin = 16;

let lastInspectedTime = 0;
// Can't start at 0 as otherwise it messes with page load.
let lastInspectedTime = -Infinity;

let lastClicked;

Expand Down Expand Up @@ -64,7 +65,7 @@ function InspectOnClick({frameRef, loaded}) {
return () => {
doc.removeEventListener('click', listener);
}
}, [frameClickBehavior, loaded]);
}, [frameClickBehavior, loaded, openFirstOnInspect]);

useEffect(() => {
if (performance.now() - lastInspectedTime < 400) {
Expand Down

0 comments on commit 02cf781

Please sign in to comment.