diff --git a/modules/apps/frontend-editor/frontend-editor-alloyeditor-web/src/main/resources/META-INF/resources/js/alloyeditor_source.js b/modules/apps/frontend-editor/frontend-editor-alloyeditor-web/src/main/resources/META-INF/resources/js/alloyeditor_source.js
index 6a58219ee3cdb98c8453ad661f84faa5ccfa49ee..f57ec65fc5f60a689744c0081f9fd4a499fbad70 100644
--- a/modules/apps/frontend-editor/frontend-editor-alloyeditor-web/src/main/resources/META-INF/resources/js/alloyeditor_source.js
+++ b/modules/apps/frontend-editor/frontend-editor-alloyeditor-web/src/main/resources/META-INF/resources/js/alloyeditor_source.js
@@ -329,7 +329,8 @@ AUI.add(
 						var editorSwitchContainer = editorSwitch.ancestor();
 						var editorSwitchTheme = instance._editorSwitchTheme;
 						var editorWrapper = instance._editorWrapper;
-
+						var editorContent = editorWrapper.one('.alloy-editor');
+		
 						editorWrapper.toggleClass(CSS_SHOW_SOURCE);
 						editorSwitchContainer.toggleClass(CSS_SHOW_SOURCE);
 						editorFullscreen.toggleClass('hide');
@@ -340,6 +341,13 @@ AUI.add(
 						editorSwitch.one('.lexicon-icon').replace(instance._getEditorStateLexiconIcon());
 						editorSwitch.setAttribute('data-title', instance._isVisible ? Liferay.Language.get('text-view') : Liferay.Language.get('code-view'));
 
+						if (editorContent.hasAttribute('hidden')) {
+							editorContent.removeAttribute('hidden');
+						}
+						else {
+							editorContent.setAttribute('hidden');
+						}
+
 						instance._refreshTooltip();
 
 						instance._toggleSourceSwitchFn(