-
Notifications
You must be signed in to change notification settings - Fork 2.2k
DOC: fix mobile menu #7968
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
base: main
Are you sure you want to change the base?
DOC: fix mobile menu #7968
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.
Pull Request Overview
This PR fixes mobile menu navigation issues on iOS/Safari by adding custom JavaScript and CSS overrides to the documentation build configuration. The fix addresses reported issues where the hamburger menu and navigation header were non-responsive on mobile Safari (issue #7936).
- Added touch event handling to bridge touchstart events to click events for mobile menu toggles
- Added CSS overrides for z-index and pointer-events to ensure navigation elements are interactive on iOS
- Updated Sphinx configuration to include the new static assets
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| docs/source/conf.py | Updated html_static_path, html_css_files, and html_js_files to include new mobile menu fix assets |
| docs/source/_static/js/mobile-menu-fix.js | Added JavaScript touch event handler that dispatches synthetic click events for mobile navigation toggles |
| docs/source/_static/css/mobile-menu-fix.css | Added CSS rules with z-index and pointer-events overrides to make navigation elements clickable on mobile devices |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| e.preventDefault(); | ||
| this.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true })); | ||
| } catch (err) { | ||
| // ignore errors | ||
| } | ||
| }, { passive: false }); |
Copilot
AI
Nov 20, 2025
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.
The touchstart listener is registered with { passive: false } to allow preventDefault(), which can negatively impact scroll performance on mobile devices. Modern browsers show warnings when non-passive touch listeners are added because they can block the browser's ability to quickly respond to scrolling. Consider making the listener passive and removing the preventDefault() call, as the synthetic click event should work without preventing the default touch behavior.
| e.preventDefault(); | |
| this.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true })); | |
| } catch (err) { | |
| // ignore errors | |
| } | |
| }, { passive: false }); | |
| this.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true })); | |
| } catch (err) { | |
| // ignore errors | |
| } | |
| }); |
| // bridge: prevent default then dispatch a MouseEvent click. | ||
| try { | ||
| e.preventDefault(); | ||
| this.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true })); |
Copilot
AI
Nov 20, 2025
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.
The synthetic MouseEvent dispatched here may bypass accessibility features that screen readers and assistive technologies rely on. Touch events are properly exposed to accessibility APIs, but synthetic click events might not be. Consider testing with VoiceOver (iOS) or TalkBack (Android) to ensure users with screen readers can still navigate the menu, or add explicit ARIA live region announcements when the menu state changes.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
This PR adds a small documentation-only fix to make the site navigation responsive on mobile (especially iOS/Safari).
What I changed
docs/source/_static/js/mobile-menu-fix.js-- a small touchstart --> click bridge for mobile menu toggles.docs/source/_static/css/mobile-menu-fix.css-- z-index and pointer-events overrides to ensure the nav overlay and toggles are clickable on iOS.docs/source/conf.pyto include the CSS and JS viahtml_static_path,html_css_files, andhtml_js_files.Why
well ,I have check it it seems fine, (Sry for pr issue i am not good at writing pr had to use some tools but no use, peace !!)
hope this pr will be fine, !!