Compare commits

...

1 Commits

Author SHA1 Message Date
Davy Hélard
2a03c8902d Fix a lost of focus when a condition is pasted 2024-07-26 15:53:31 +02:00

View File

@@ -1275,6 +1275,14 @@ export class EventsSheetComponentWithoutHandle extends React.Component<
},
() => {
if (this._eventsTree) this._eventsTree.forceEventsUpdate();
// The focus is lost because the button "(or paste conditions/actions)"
// no long exist.
// Ideally, we'd wait for the events to be updated, but
// to simplify the code, we just wait a few ms for a new render
// to be done.
setTimeout(() => {
this._ensureFocused();
}, 100); // A few ms is enough for a new render to be done.
}
);
};