fix(widgets) events in react reverse controlled env#8893
Merged
Pessimistress merged 6 commits intomasterfrom Feb 24, 2026
Merged
fix(widgets) events in react reverse controlled env#8893Pessimistress merged 6 commits intomasterfrom
Pessimistress merged 6 commits intomasterfrom
Conversation
chrisgervang
commented
May 14, 2024
Signed-off-by: Chris Gervang <chris@gervang.com>
Signed-off-by: Chris Gervang <chris@gervang.com>
Signed-off-by: Chris Gervang <chris@gervang.com>
8961626 to
b734efa
Compare
Pessimistress
approved these changes
Feb 23, 2026
felixpalmer
reviewed
Feb 25, 2026
| import type {Color, PickingInfo, MapViewState} from '@deck.gl/core'; | ||
| import type {Feature, Polygon, MultiPolygon} from 'geojson'; | ||
| import {CompassWidget, ZoomWidget, FullscreenWidget} from '@deck.gl/widgets'; | ||
| import '@deck.gl/widgets/stylesheet.css'; |
Collaborator
There was a problem hiding this comment.
@chrisgervang adding this broke the website build with the latest loaders, any idea why? f939449
Collaborator
Author
There was a problem hiding this comment.
What's the error? How confident are we it has to do with loaders, or could it also be broken on master?
Collaborator
There was a problem hiding this comment.
Module not found: Error: Can't resolve '@deck.gl/widgets/stylesheet.css' in '/home/runner/work/deck.gl/deck.gl/examples/website/arc'
see: https://github.com/visgl/deck.gl/actions/runs/22398533353/job/64838419323
It doesn't seem broken on master, so it's a bit of a mystery to me
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.
Closes #8877
Background
Exploring a way to exclude widgets from the deck event manager and push it above maplibre. Currently mouse event on a widget performs deck picking, which is an unwanted interaction.
propagation_short.mov
Rearranging the DOM so that the deck picker and widgets are peer elements fix the deck picking issue. Also, by nesting the deck children, such as react-map-gl in reversed controlled configuration, the deck widgets events aren't blocked by maplibre.
react-widget-dom.mov
Flavors to test:
Change List
parent, selects an.event-manager-rootelement for EventManager to use for picking.parent, selects an.deck-widgets-containerelement for WidgetManager to add widgets to.<DeckGL/>children under.event-manager-root.deck-widgets-containerNote
Medium Risk
Changes the DOM structure and event-root selection for React rendering, which can affect pointer/gesture handling and widget placement across integrations, though it preserves fallbacks for non-React/legacy setups.
Overview
Fixes widget interaction issues in React reverse-controlled basemap setups by splitting the DOM roots for input events vs. widgets.
React
DeckGLnow renders a.deck-events-rootwrapper containing the canvas + children, and a sibling.deck-widgets-rootcontainer for widgets. CoreDeckinitialization is updated to attachEventManagerto.deck-events-root(when present) andWidgetManagerto.deck-widgets-root(falling back to the prior parents when absent).The
arcwebsite example is updated to include@deck.gl/widgets(Zoom/Compass/Fullscreen) and its stylesheet to exercise the new behavior.Written by Cursor Bugbot for commit 103fd90. This will update automatically on new commits. Configure here.