fix(client): prevent jumping between editor tabs (#43771)

This commit is contained in:
Oliver Eyton-Williams
2021-10-08 23:14:15 +02:00
committed by GitHub
parent bba3b6f8a4
commit 461e429598

View File

@ -967,10 +967,13 @@ const Editor = (props: EditorProps): JSX.Element => {
updateOutputZone();
}
editor?.focus();
if (isProjectStep() && editor) {
if (hasChangedContents) showEditableRegion(editor);
if (hasChangedContents && !isProjectStep()) editor?.focus();
if (isProjectStep() && editor) {
if (hasChangedContents) {
editor.focus();
showEditableRegion(editor);
}
// resetting test output
// TODO: DRY this - createOutputNode doesn't also need to set this up.
const testButton = document.getElementById('test-button');