Skip to content

Custom marker onclick does not work #196

@EldinHb

Description

@EldinHb

I cant get onClick to work on a Marker with children.

<Marker 
	onClick={() => console.log('marker')}
	key={route.journeyNumber} 
	anchor={[Number.parseFloat(route.latLon.latitude), Number.parseFloat(route.latLon.longitude)]}>
		<div onClick={() => console.log('marker child')} className='bg-white'>
			custom icon
		</div>
</Marker>

Neither marker or marker children gets logged. If I remove the children then onClick works on the marker. What am I doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions