diff --git a/src/widgets/chain-editor/ui/ChainEditor.tsx b/src/widgets/chain-editor/ui/ChainEditor.tsx
index 020e835..9824e0c 100644
--- a/src/widgets/chain-editor/ui/ChainEditor.tsx
+++ b/src/widgets/chain-editor/ui/ChainEditor.tsx
@@ -58,6 +58,7 @@ export default function ChainEditor({ chain }: ChainEditorProps) {
- actionsListRef.current?.scrollTo({
- behavior: "smooth",
- top: actionsListRef.current.scrollHeight,
- }),
- 0,
- );
+ if (addingNewAction) {
+ setTimeout(
+ () =>
+ actionsListRef.current?.scrollTo({
+ behavior: "smooth",
+ top: actionsListRef.current.scrollHeight,
+ }),
+ 0,
+ );
+ }
}}
onClose={() => {
if (addingNewAction) setAddingNewAction(false);
@@ -120,7 +123,9 @@ export default function ChainEditor({ chain }: ChainEditorProps) {
chain={chain}
action={action}
actionIndex={index}
- onEdit={setActionToEdit}
+ onEdit={(actionIndex) => {
+ setActionToEdit(actionIndex);
+ }}
/>
))}