Skip to content

[Bug] onMouseEnter on AdvancedMarker only works when onClick is set #542

@antonio-pbilby

Description

@antonio-pbilby

Description

Using the onMouseEnter with a AdvancedMarker is only working when the same AdvancedMarker has a onClick property set.
If I'm using the standar Pin, it works just fine.

Steps to Reproduce

<APIProvider
  apiKey={import.meta.env.VITE_API_GOOGLE_MAPS_API_KEY}
  region="BR"
  language="pt-BR"

>
  <Map
    defaultCenter={{
      lat: -15.4,
      lng: -47.4,
    }}
    defaultZoom={10}
    id="plots-list"
    mapId={import.meta.env.VITE_API_GOOGLE_MAPS_MAP_ID}
  >
    {plotLocations.map((plot) => {
      return <AdvancedMarker position={plot.location} key={plot.id} onMouseEnter={() => console.log('test')}
        onClick={() => {}}
      >
        <div>dummy component</div>
      </AdvancedMarker>
    })}
  </Map>
</APIProvider>

Environment

  • Library version: 1.2.0
  • Google maps version: weekly
  • Browser and Version: Chrome 128.0.6613.138 (Official Build) (64-bit)
  • OS: Windows 11

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions