-
Notifications
You must be signed in to change notification settings - Fork 33
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 content is non-interactive (react components are rendered as static markup in Popup content) #182
Comments
I have come up with this work around, but its ugly as hell. There's probably a better way of doing this; I'm no React expert by any stretch. But it works.
Would be really nice if you could please facilitate passing a JSX element to AzureMapPopup popupContent which gets rendered as "real interactive react" instead of static non interactive react (not sure on the terminology here, but i'm running with anyway). Maybe if you pass react children into the AzureMapPopup component it could render it as "real interactive react". |
One possible approach would be to create a custom Popup component, similar to You'll need to use the I believe @adityagupta-msft has implemented something similar, so maybe he can also provide a code snippet. |
Could we get this added to this library? Surely a lot of people would want this functionality. |
I really really need to be able to display interactive React within a popup. It blows my mind that no one else is wanting this. Can I please please please get an example of how to do this. @adityagupta-msft you were referenced as maybe having a solution? |
Hi @rdo-mgowland, sorry I missed this. The solution I came up with is the following:
It takes functionality from useCreateAzureMapPopup.ts and I created a new popup component called GeoMapPopup which can be used. I am not sure about the efficiency of the solution as it requires creating a new DOM element every time but I hope it helps! |
See @adityagupta-msft's comment for a working solution. |
I have buttons that display in my popups that I need the user to be able to click.
I believe the click events on the buttons within a popup are not working becuase when rendering the popup content you are using renderToStaticMarkup.
I think useCreateAzureMapPopup should be changed from this:
To actually render the react component so it can have interactive content.
The text was updated successfully, but these errors were encountered: