Skip to content

Conversation

@immortal71
Copy link
Contributor

@immortal71 immortal71 commented Nov 20, 2025

This PR adds a small documentation-only fix to make the site navigation responsive on mobile (especially iOS/Safari).

What I changed

  • Added docs/source/_static/js/mobile-menu-fix.js -- a small touchstart --> click bridge for mobile menu toggles.
  • Added 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.
  • Updated docs/source/conf.py to include the CSS and JS via html_static_path, html_css_files, and html_js_files.

Why

  • Users reported the hamburger menu and main header being non-responsive on mobile Safari (issue DOC: Menu on docs website uninteractable on mobile. #7936). The changes are minimal and non-invasive; they override behavior via docs static assets rather than editing installed theme packages.

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, !!

Copilot AI review requested due to automatic review settings November 20, 2025 06:20
Copilot finished reviewing on behalf of immortal71 November 20, 2025 06:22
Copy link

Copilot AI left a 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.

Comment on lines 20 to 25
e.preventDefault();
this.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true }));
} catch (err) {
// ignore errors
}
}, { passive: false });
Copy link

Copilot AI Nov 20, 2025

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.

Suggested change
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
}
});

Copilot uses AI. Check for mistakes.
// bridge: prevent default then dispatch a MouseEvent click.
try {
e.preventDefault();
this.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true }));
Copy link

Copilot AI Nov 20, 2025

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant