-
Notifications
You must be signed in to change notification settings - Fork 164
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
WD-2617 - Add sliding animation to sub navigation on mobile #4714
WD-2617 - Add sliding animation to sub navigation on mobile #4714
Conversation
Demo starting at https://vanilla-framework-4714.demos.haus |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@bartaz @pedoch oops I updated this branch directly instead of creating a PR targeting it. Let me know if it's ok. here I add the vanillaFramework.slidingNav('element') As a side, I tried to use rollup to mimic what we do in the cookie policy repo but I couldn't get it working so I opted for esbuild instead. |
8c28a72
to
6bb0a60
Compare
@ClementChaumel I just reverted your commit, it was causing some CI checks fail, and demo didn't run, so make a separate PR and make sure it runs (I guess docker config may need updating to include the built JS file).
I think we should do it from the start. Once we settle on JS API and expose it we don't want to change it. So good to make it future-proof from the start. So something like: vanillaFramework.setupMobileNavigation();
vf.setupMobileNavigation(); We can discuss details in your separate PR I guess. |
This comment was marked as resolved.
This comment was marked as resolved.
1e8293e
to
36420a9
Compare
36420a9
to
da06e22
Compare
Thanks for all the updates. Two small issues remaining: When you open a dropdown (in mobile mode) and resize screen, dropdown gets closed (but menu remains open). But some class names must be incorrect, because you have to click TWICE on the menu item to reopen this dropdown again. Second issue is when screen is smaller than menu (for example in mobile landscape mode). When you open dropdown with small number of items you can scroll down and reveal the previous panel. |
747b985
to
38a7d4f
Compare
054a4c6
to
28c8af6
Compare
- add the styling and the example for the sliding navigation
- fix some lint issues and code review comments
drivebys: - fix scss linter max-nesting-depth error - correct html mark up
- implement the animation use the same concept as the side navigation - use new menu button
- make navigation separtor be on top - fixed unexpected animation - implement pressed state background on the navigation - fix chevron rotation on dropdown toggle - create new classname for back button (stick with convention) - prevent parent slide from scrolling when content is longer than the viewport and child slide is open
- for alpha test - minor update
16e1eb7
to
78ce9eb
Compare
faacd51
to
aa9e8e6
Compare
aa9e8e6
to
9b41447
Compare
@pedoch Good work on the animation! Few small issues I noticed:
I think a way to reproduce it is:
I guess some class names are not removed and mobile styles are applied? |
f962bde
to
22e578a
Compare
- add new search example - fix navigation bugs
22e578a
to
5f5a194
Compare
Discussing on Jira. |
@@ -0,0 +1,67 @@ | |||
function initNavigationSearch(element) { |
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.
I haven't looked into details, but how different it is from existing script for search? https://github.com/canonical/vanilla-framework/blob/main/templates/docs/examples/patterns/navigation/_script-search.js
This looks to be share a lot, would it be possible for one script to handle both existing version and sliding version?
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.
Okay, I'll try combining the file so they work for both versions of the navigation
560e88c
to
887c244
Compare
The overlay makes the animation resemble that of iOS
@juanruitina @lyubomir-popov would something like that be ok? (I slowed it down to demonstrate better what's happening but it would be quicker ofc) |
Done
Fixes/Issues
QA
Navigation / Sliding
under components and make it behaves as expected.Check if PR is ready for release
If this PR contains Vanilla SCSS code changes, it should contain the following changes to make sure it's ready for the release:
Feature 🎁
,Breaking Change 💣
,Bug 🐛
,Documentation 📝
,Maintenance 🔨
.package.json
should be updated relative to the most recent release, following semver convention:Screenshots
[if relevant, include a screenshot or screen capture]