Opened 3 years ago
Closed 3 years ago
#54210 closed defect (bug) (fixed)
Admin menu collapse button inactive at 960px
Reported by: | Webaxones | Owned by: | johnjamesjacoby |
---|---|---|---|
Milestone: | 5.9 | Priority: | normal |
Severity: | normal | Version: | 5.8.1 |
Component: | Administration | Keywords: | has-patch has-testing-info commit has-screenshots |
Focuses: | ui, accessibility, javascript, administration | Cc: |
Description
If your browser is sized at 942px (942px on Chrome, 943px on Firefox) with the admin menu already collapsed, the collapse button appears to do nothing.
If user click on it, nothing happens.
And this happens because the media query targets a max-width of 960px instead of targeting 959.98px for example.
This may seem like a minor bug, but this screen dimension is exactly the one you get on a 1920px resolution screen when you ask your OS (windows for example) to display 2 browsers side by side: 2 WP admin screens with 2 buttons that don't work.
Attachments (4)
Change History (22)
#1
follow-up:
↓ 2
@
3 years ago
- Focuses javascript added; css removed
- Keywords has-patch added
- Milestone changed from Awaiting Review to 5.9
#2
in reply to:
↑ 1
@
3 years ago
Indeed. Sorry I didn't search any further because I thought the problem was unlikely to be qualified as a bug. I should have :)
Replying to sabernhardt:
Hi and thanks for the report!
The problem seems to be in the common.js file, not CSS.
viewportWidth < 960
did not include 960 pixels, so I switched the operator to less than or equal to 960.
#3
@
3 years ago
- Keywords needs-testing added
@Webaxones That comment was (more) for other people; you did not need to know exactly where the problem was. The fact that you found a bug and reported it is plenty :)
For anyone testing the patch:
- Access a WordPress admin screen (page) with a desktop-sized monitor.
- Adjust the browser window size so the side admin menu's auto-fold feature collapses the menu. Make sure the width is only one pixel narrower than where the side menu is expanded.
- Click on the arrow link at the bottom to Expand Main Menu. This should not work correctly before applying the patch.
- Apply the patch. Verify that the JavaScript compiles correctly and is not cached.
- Refresh the browser at the same size.
- Click on the arrow link at the bottom to Expand Main Menu. Verify that the menu expands now.
#4
@
3 years ago
Hmm ok thanks @sabernhardt for the sharing the testing process, now I understand why I wasn't able to reproduce the issue. I'll test again later today.
This ticket was mentioned in Slack in #core-test by boniu91. View the logs.
3 years ago
#7
@
3 years ago
Test Report
Test Environment
- WordPress: 5.9-alpha-51272-src
- Browser: Google Chrome Version 94.0.4606.61 (Official Build) (x86_64)
- OS: macOS Big Sur V 11.5.1
- Theme: Twenty Twenty-One
- Web Server: nginx
- PHP & MySQL: 8.0.0 & 8.0.16
- Console Log: All fine
- WP Debug Log: All fine.
Steps to Test
- Go to WP Dashboard.
- Right click and click on the 'Inspect'option.
- Click on kebab menu(three dots) and select 'Dock to right' option.
- Now click on browser resizer option.
- Select Dimensions 'Responsive'
- Change the width to 960.
- Click on 'Expand' menu icon.
- This action will do nothing on click.
- Apply patch file and build all assets.
- Click on 'Expand'icon.
- Menu will expand/collapse as expected.
Test Results
Menu Expand/Collaps actions are working expected on screen size 960px.
Test Status
Pass(on Mac)
PS: Would be great if someone also check once on Windows machine.
ScreenCast (videos)
Attached.
This ticket was mentioned in Slack in #core-test by ankit-k-gupta. View the logs.
3 years ago
#10
@
3 years ago
This issue seems to be more widespread than just the admin menu. A similar bug can be replicated on the front end. Drop this code into any page or post to replicate:
<div id="change">This starts blue and turns red below 1400px</div> <style> #change {color: blue;} @media only screen and (max-width:1400px) { #change { color: red;} } </style>
From a screen width of 1384px to 1920px the color is blue. The 1400px max-width media query doesn't kick in until 1383px. (The text turns red 17 pixels late)
Test Environment
WP Version: 5.8.1
PHP Version: 7.3
Browser: All of em'
Theme: Twenty Twenty One
Web Server: Apache
Logs: Nothing
#11
@
3 years ago
@abesell132 When the media query style change starts acting at about 17 pixels less than the breakpoint value, that likely is because browsers include the scrollbar within that number. If the page does not have enough content to involve scrolling, however, then the window width should match the media query max-width
.
#12
@
3 years ago
- Summary changed from Admin collapse button inactive due to a media query incorrectly targeting a breakpoint to Admin menu collapse button inactive at 960px
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-test by mai21. View the logs.
3 years ago
#16
@
3 years ago
Test Report
Reproducible and Fixed (click collapse button now is working on width 960, 961,959)
Env
- WordPress 5.9-alpha-51947
- Chrome 95.0.4638.54
- Ubuntu 18.04.6
- Theme: Twenty Twenty One
Hi and thanks for the report!
The problem seems to be in the common.js file, not CSS.
viewportWidth < 960
did not include 960 pixels, so I switched the operator to less than or equal to 960.