From e3e794ddefa87c80637bae2fb868378c2a2905b4 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Wed, 6 Oct 2021 23:09:04 +0200 Subject: [PATCH] fix(client): only jump to editable region on reset (#43748) If the code has changed without the user typing (e.g. they've pushed the restart button), then we jump them back to the editable region. Otherwise (e.g. they've typed in the editor) we reset the display, but do not move the editor. --- client/src/templates/Challenges/classic/editor.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/templates/Challenges/classic/editor.tsx b/client/src/templates/Challenges/classic/editor.tsx index 43616a1fa8..47fad7b12b 100644 --- a/client/src/templates/Challenges/classic/editor.tsx +++ b/client/src/templates/Challenges/classic/editor.tsx @@ -969,7 +969,7 @@ const Editor = (props: EditorProps): JSX.Element => { editor?.focus(); if (isProjectStep() && editor) { - showEditableRegion(editor); + if (hasChangedContents) showEditableRegion(editor); // resetting test output // TODO: DRY this - createOutputNode doesn't also need to set this up.