-
Notifications
You must be signed in to change notification settings - Fork 50
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
popup #285
Comments
I do not encounter this problem, so it might be an issue specific with your implementation approach. Could provide a code example that reproduces this problem? |
<MapGL |
When the popup is closed, the respective html tags are removed from the DOM. The React element remains. The way this component is implemented makes a lot of sense in an imperative style JavaScript - but in React, it is ideal if your React components reflect the application state. When the popup is closed, the React virtual DOM is no longer in sync with the actual DOM. Something like this would be preferrable: <Popup
open={open}
onClose={() => setOpen(false)}
closeButton={true}
closeOnClick={true}
{...popupLongLat}
/> In contrast to just: <Popup
closeButton={true}
closeOnClick={true}
{...popupLongLat}
/> An example of how something similar is accomplished in Material UI: The way it is done in uber/react-map-gl: Notice the short-ciruiting behaviour that essentially recreates the popup when showPopup switches to false and then back to true. |
popup appear at the first when clicked on a point, when popup is closed it wont re-appear after clicking on another point. if the popup is not closed then it appears on all points.
The text was updated successfully, but these errors were encountered: