-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in left navigation #526
Bug in left navigation #526
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but as discussed please provide better names for the css breakpoints, like for example desktopMinWidth for JS variable (desktop-min-width for CSS) instead of desktopBreakpoint ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my comments below
core/src/App.html
Outdated
@@ -545,9 +547,37 @@ | |||
}); | |||
}, | |||
onResize() { | |||
if (window.innerWidth >= CSS_BREAKPOINTS.desktopMinWidth) { | |||
const simpleDesktopToMobile = () => { | |||
if (this.get().responsiveNavSetting == 'simple') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please always use ===
instead of ==
. You will be always be right using ===
core/src/App.html
Outdated
this.closeLeftNav(); | ||
} | ||
|
||
simpleDesktopToMobile(); | ||
this.get().previousBreakpoint = window.innerWidth; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use better this.set({ previousBreakpoint: window.innerWidth });
. Otherwise we are doing a mutation of the component state. It is better to let Svelte do the state updates itself, by just telling Svelte what we want to update with this.set
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my comments
Changes proposed in this pull request:
constants.js
fileviewport
metatag to see the mobile navigation