Skip to content

Commit

Permalink
wait 500ms before scrolling item into view so the user has time for a…
Browse files Browse the repository at this point in the history
… double click
  • Loading branch information
vincentfretin committed Sep 10, 2024
1 parent a277e5c commit 32b75eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/editor/components/scenegraph/SceneGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down

0 comments on commit 32b75eb

Please sign in to comment.