Repository navigation
feat(embed): gestures=cooperative lets the host page scroll past a contained map - #251
Merged
Merged
Conversation
…ntained map A map sized into a page took every wheel and one-finger gesture, so a visitor scrolling down an article got stuck on the map. `gestures= cooperative` turns on Mapbox's cooperative gestures for a contained map: the page scrolls, and the map moves on two fingers or Ctrl/⌘ + wheel. A window-filling map and the compact card's overlay ignore it. The WordPress plugin's shortcode and block embeds will send it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Deploying sahajatlas with
|
| Latest commit: |
27f397a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8e5690ea.sahajatlas.pages.dev |
| Branch Preview URL: | https://feat-cooperative-gestures.sahajatlas.pages.dev |
Deploying sahajatlas-design with
|
| Latest commit: |
27f397a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://178a9e6a.sahajatlas-design.pages.dev |
| Branch Preview URL: | https://feat-cooperative-gestures.sahajatlas-design.pages.dev |
Contributor
Author
|
The WordPress browser lane confirms the fix. sydevs/SahajAtlasWordpress#61's new article check puts a bare
The |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gestures=cooperative. A contained map uses Mapbox's cooperative gestures with it on: one finger and the mouse wheel scroll the host page, and the map moves on two fingers or Ctrl/⌘ + wheel, with Mapbox's hint overlay saying so.cooperative, the same rule asrouting=path. No current host changes.docs/embedding.md(six parameters now) andCHANGELOG.mdare updated.Why: the WordPress plugin's
[sahaj_atlas]shortcode is about to show the map by default, inside ordinary pages. Without this, a visitor scrolling the page with the cursor or a finger over the map zooms or pans it and can't get past. The plugin's own Atlas page fills the screen and doesn't scroll, so it won't send this.Changes
src/loader/config.ts:cooperativeonLoaderConfig, read fromgestures.src/views/FullInterface.tsx: passescontained && embed.config.cooperativeto<Mapbox>.src/components/organisms/Mapbox/Map.tsx: forwards it tocooperativeGestures. This is a constructor option in mapbox-gl 3.32, and one widget per page meansreuseMapsnever mixes values.MapFrame.test.tsx's wiring check now accepts the prop.Test results
pnpm vitest run src/loader src/views/MapFrame.test.tsx: 114 passed.pnpm buildpassed, including the CSS-scoping assertion.🤖 Generated with Claude Code