You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Button inside MarkerInfoWindow can't handle click events because the window handles them. There should be an option to disable this so we can have buttons and other clickable elements inside info windows.
There is a similar issue closed with this comment:
Closing this issue, MarkerInfoWindow can handle ClickEvents:
MarkerInfoWindow(
state = rememberMarkerState(position = LatLng(1.35, 103.87)),
onClick = {
Log.d("Hi", "I am a click event")
true
}
)
But this answer doesn't solve the problem at all. The onClick parameter is for the marker, not the window and the onInfoWindowClick: (Marker) -> Unit = {} parameter doesn't allow us to return Boolean.
Version
maps-compose version 4.3.0
Steps to reproduce
Create a MarkerInfoWindow with a Button as content
Code example
MarkerInfoWindow(
state = rememberMarkerState(
position = LatLng(0.0, 0.0)
),
) {
Text("Title")
Button(
onClick = {
// do something
}
) {
Text("Button")
}
The text was updated successfully, but these errors were encountered:
dreson00
added
triage me
I really want to be triaged.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
labels
Mar 31, 2024
If you would like to upvote the priority of this issue, please comment below or react on the original post above with 👍 so we can see what is popular when we triage.
@dreson00 Thank you for opening this issue. 🙏
Please check out these other resources that might help you get to a resolution in the meantime:
Note: The info window that is drawn is not a live view. The view is rendered as an image (using View.draw(Canvas)) at the time it is returned. This means that any subsequent changes to the view will not be reflected by the info window on the map. To update the info window later (for example, after an image has loaded), call showInfoWindow(). Furthermore, the info window will not respect any of the interactivity typical for a normal view such as touch or gesture events. However you can listen to a generic click event on the whole info window as described in the section below.
Button inside MarkerInfoWindow can't handle click events because the window handles them. There should be an option to disable this so we can have buttons and other clickable elements inside info windows.
There is a similar issue closed with this comment:
Originally posted by @kikoso in #200 (comment)
But this answer doesn't solve the problem at all. The
onClick
parameter is for the marker, not the window and theonInfoWindowClick: (Marker) -> Unit = {}
parameter doesn't allow us to return Boolean.Version
maps-compose version 4.3.0
Steps to reproduce
Code example
The text was updated successfully, but these errors were encountered: