Skip to content

Commit

Permalink
fix: auto-opening sidebar #1090 (#1787)
Browse files Browse the repository at this point in the history
* updated the sidebar; on mobile devices, the sidebar will be closed by default

* updated the AppSideBar

* change variable name

Co-authored-by: Hayden <[email protected]>
  • Loading branch information
dorj222 and hay-kot authored Nov 11, 2022
1 parent 2a797a2 commit 703cfd7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions frontend/components/Layout/AppSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,20 @@ export default defineComponent({
},
},
setup(props, context) {
// V-Model Support
const drawer = computed({
// V-Model Support
const drawer = computed({
get: () => {
return props.value;
},
set: (val) => {
context.emit("input", val);
if(window.innerWidth < 760 && state.hasOpenedBefore === false){
state.hasOpenedBefore = true;
val = false
context.emit("input", val);
}
else{
context.emit("input", val);
}
},
});
Expand All @@ -191,6 +198,7 @@ export default defineComponent({
topSelected: null as string[] | null,
secondarySelected: null as string[] | null,
bottomSelected: null as string[] | null,
hasOpenedBefore: false as boolean,
});
return {
Expand Down

0 comments on commit 703cfd7

Please sign in to comment.