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
Empty ghost popup left over when dynamically rendering marker popup #832
Comments
Should be fixed in v3.2, please try it out! |
Hi, the same problem is reproduced in v.3.2. Also the tooltip behaves when I dynamically change styles. It seems that the old component is not unmountable. |
Hi, I'm too using "react-leaflet": "^3.2.0", and problem is still here. I wrap my markers with MarkerClusterGroup and set a different key every time my marker list is changed
|
Bug report
Updated for v3
Expected behavior
I'm attempting to dynamically render a marker Popup using a boolean to control whether it renders like so:
showPopup && <Popup>content</Popup>
. WhenshowPopup == false
, no popup should appear when clicking a marker. WhenshowPopup == true
, the popup should appear when clicking a marker. Further, ifshowPopup == true
and you click a marker to show its popup, settingshowPopup == false
should make the popup disappear.Actual behavior
It works when going from
false
totrue
-- the popup enables on click -- but when a popup is open andshowPopup
goes fromtrue
tofalse
, an empty popup box is left over, even though the popup component is not present in the component tree according to the React browser plugin.Steps to reproduce
CodeSandbox Example
There's a button at the top left to toggle
showPopup
.Stack Overflow question for this issue
The text was updated successfully, but these errors were encountered: