From 32b75ebde4bb49b89eb81d6870919e6d1855b7bf Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Tue, 10 Sep 2024 11:26:45 +0200 Subject: [PATCH] wait 500ms before scrolling item into view so the user has time for a double click --- src/editor/components/scenegraph/SceneGraph.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/editor/components/scenegraph/SceneGraph.js b/src/editor/components/scenegraph/SceneGraph.js index 275ca644..e6ae45f4 100644 --- a/src/editor/components/scenegraph/SceneGraph.js +++ b/src/editor/components/scenegraph/SceneGraph.js @@ -89,11 +89,12 @@ export default class SceneGraph extends React.Component { for (let i = 0; i < this.state.entities.length; i++) { const entityOption = this.state.entities[i]; if (entityOption.entity === entity) { - this.setState({ selectedIndex: i }, () => { + this.setState({ selectedIndex: i }); + setTimeout(() => { document .getElementById('sgnode' + i) ?.scrollIntoView({ behavior: 'smooth' }); - }); + }, 500); // Make sure selected value is visible in scenegraph this.expandToRoot(entity); posthog.capture('entity_selected', {