mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-10-24 23:49:06 +08:00
fix(client): prevent jumping between editor tabs (#43771)
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user