-
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
Changes from 1 commit
552dff8
94e45d7
d19dd97
99cd2e3
19d07b4
8e42bd3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| /* Mobile menu fix: ensure overlay is clickable on iOS */ | ||
|
|
||
| /* Raise the stacked navigation elements above possible overlays */ | ||
| .primary-toggle, | ||
| .secondary-toggle, | ||
| .navbar, | ||
| .navbar-collapse, | ||
| #pst-primary-sidebar-modal, | ||
| #pst-secondary-sidebar-modal { | ||
| z-index: 10000 !important; | ||
immortal71 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| pointer-events: auto !important; | ||
| } | ||
|
|
||
| /* Ensure the modal overlay allows pointer events to reach menu links */ | ||
immortal71 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| .pst-modal-backdrop { | ||
| pointer-events: auto !important; | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,30 @@ | ||||||||||||||||||||||||
| // Mobile menu fix: make touch interactions on mobile (iOS/Safari) reliably trigger | ||||||||||||||||||||||||
| // the mobile navigation toggle. Minimal, defensive enhancement. | ||||||||||||||||||||||||
| document.addEventListener('DOMContentLoaded', function () { | ||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||
| const selectors = [ | ||||||||||||||||||||||||
| '.primary-toggle', | ||||||||||||||||||||||||
| '.secondary-toggle', | ||||||||||||||||||||||||
| '[data-toggle="collapse"]', | ||||||||||||||||||||||||
| '[aria-controls][aria-expanded]' | ||||||||||||||||||||||||
immortal71 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||||||||||
| ].join(','); | ||||||||||||||||||||||||
| const controls = Array.from(document.querySelectorAll(selectors)); | ||||||||||||||||||||||||
| controls.forEach(el => { | ||||||||||||||||||||||||
| if (el.__pymc_touchbound) return; | ||||||||||||||||||||||||
| el.__pymc_touchbound = true; | ||||||||||||||||||||||||
| el.addEventListener('touchstart', function (e) { | ||||||||||||||||||||||||
| // iOS sometimes doesn't synthesize click events for transformed | ||||||||||||||||||||||||
| // elements or elements in certain stacking contexts. Best-effort | ||||||||||||||||||||||||
| // bridge: prevent default then dispatch a MouseEvent click. | ||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||
| e.preventDefault(); | ||||||||||||||||||||||||
immortal71 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||||||||||||||||
| this.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true })); | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
| } catch (err) { | ||||||||||||||||||||||||
| // ignore errors | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| }, { passive: false }); | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
| 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 | |
| } | |
| }); |
Uh oh!
There was an error while loading. Please reload this page.