diff --git a/packages/editor-ui/src/components/MainSidebar.vue b/packages/editor-ui/src/components/MainSidebar.vue index eaf85a60f..6943a557b 100644 --- a/packages/editor-ui/src/components/MainSidebar.vue +++ b/packages/editor-ui/src/components/MainSidebar.vue @@ -281,9 +281,6 @@ export default mixins( if (this.$refs.user) { this.$externalHooks().run('mainSidebar.mounted', { userRef: this.$refs.user }); } - if (window.innerWidth > 900 && !this.isNodeView) { - this.$store.commit('ui/expandSidebarMenu'); - } this.checkWidthAndAdjustSidebar(window.innerWidth); await Vue.nextTick(); this.fullyExpanded = !this.isCollapsed; @@ -457,8 +454,10 @@ export default mixins( this.checkWidthAndAdjustSidebar(browserWidth); }, checkWidthAndAdjustSidebar (width: number) { - if (width < 900) { + if (width < 900 || this.isNodeView) { this.$store.commit('ui/collapseSidebarMenu'); + } else { + this.$store.commit('ui/expandSidebarMenu'); } }, }, diff --git a/packages/editor-ui/src/modules/ui.ts b/packages/editor-ui/src/modules/ui.ts index 53ac6f76d..067ad2169 100644 --- a/packages/editor-ui/src/modules/ui.ts +++ b/packages/editor-ui/src/modules/ui.ts @@ -110,7 +110,7 @@ const module: Module = { }, }, modalStack: [], - sidebarMenuCollapsed: true, + sidebarMenuCollapsed: false, isPageLoading: true, currentView: '', mainPanelDimensions: {},