-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Fix the mobile menu wrongly expanding the logo #33877
Conversation
It is fine/collapsed on the Home Dashboard initially, but going to other sections such as Articles list, it expands again. |
When I do a refresh in Chrome with the mobile view active, the logo is initially expanded. When I resize the mobile window just a little bit, the logo shrinks and everything jumps into place. When I do a refresh again the logo is back to its initial expanded state. |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
There are still assumptions with the current code, especially for the transition to mobile or going from mobile to desktop. Could we tackle those? Probably yes by transforming the cookie value to a JSON string (store state for logo, menu state and header toolbar), but I see little advantage to complicate further the code to iron out a couple of glitches which are edge cases (e.g. clicking on the save button on mobile view will not reload the page with the toolbar open). There are trade-offs (perf vs covering all cases), and as is the script is not very efficient/performant, and my whole approach here was to eliminate as much as possible the annoying open/close animations on page reload and not to re-architecture the way we put together those underlaying parts |
This comment was marked as abuse.
This comment was marked as abuse.
@@ -217,11 +222,23 @@ function subheadScrolling() { | |||
headerItemsInDropdown(); | |||
reactToResize(); | |||
subheadScrolling(); | |||
if (mobile.matches) { |
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.
Why not using setMobile
function call inside this block?
I have tested this item ✅ successfully on cdfbb5f This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33877. |
This comment was marked as abuse.
This comment was marked as abuse.
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33877. |
Thanks! |
Pull Request for Issue #33754 (comment) and #34105
Summary of Changes
Testing Instructions
Shrink the width of your browser to a mobile width and open the menu/toolbar. The logo should not expand
Actual result BEFORE applying this Pull Request
Expected result AFTER applying this Pull Request
Documentation Changes Required