-
Notifications
You must be signed in to change notification settings - Fork 29
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
Search: Prevent visible page scroll when the search modal is open on iOS #392
Conversation
The button is still focused when the menu is closed, which makes it look active when using a pointer device. When using a keyboard, the outline also appears, which makes it clear where focus is.
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 to me 👍🏻
One of the reasons I haven't circled back to this yet is that the upstream fix is still changing, so whatever we do here might not work in the near future. Since this is already working, though, I don't see any reason to avoid merging it.
I'm unable to test this in my local environment, but for those able to, I've had good success with the free Xcode simulator to test. If it works, ship it. I also want to note that I appreciate that you shared your experiences on the upstream fix, so we can get this fixed at the core! Thank you 🙏 |
I see the search icon twice. The one in the placeholder should not exist, as my understanding. Is that a OS behavior? |
Good catch, Francisco. I think I actually have an upstream fix for that: WordPress/gutenberg#48259 and WordPress/gutenberg#49710 |
This prevents other nav modals (like the page subnav) which toggle the has-modal-open class from affecting the position of the global header bar. See #392, Fixes WordPress/wporg-parent-2021#85
* Header: Fix logo spacing on default English site Fixes issue introduced in 43a8a94 where the menu & search icons collapsed to the left on small screens. The logo flex size needs to be different when there is no locale name. * Header: Only apply page scroll fix to header modals This prevents other nav modals (like the page subnav) which toggle the has-modal-open class from affecting the position of the global header bar. See #392, Fixes WordPress/wporg-parent-2021#85
On iOS, opening the search modal in the header triggers the keyboard to open, which re-enables page scrolling. When scrolling down & back up, the page contents are visible in the gap behind the modal. This PR fixes the header bar on scroll, so that it hides that scrolled content.
It is still strange that the page can be scrolled, but the other fixes cause larger layout issues (see #371 (comment)), and this only happens when the keyboard is open (and only on iOS) this seems like the best solution.
Fixes #371, see #381, see #382.
Note: this PR also includes a small fix to prevent the icon-buttons from appearing active when the tab is closed, I only noticed it on mobile, so fixed it here.
Screenshots
To test
I used Charles.app's DNS spoofing to send *.wordpress.org traffic to my sandbox, then set my iPad to use my computer as a proxy. This let me load my sandboxed environment on my iPad. Then using the vertical orientation, I tested the header across different wporg pages.