JustFly1984 / react-google-maps-api

React Google Maps API
MIT License
1.76k stars 426 forks source link

Marker Mouse Event Not Firing #3214

Open jb-vivihealth opened 1 year ago

jb-vivihealth commented 1 year ago

Issue template

You can donate or became a sponsor https://opencollective.com/react-google-maps-api#category-CONTRIBUTE

If you want to ask question, please ask it in Github Discussions, Spectrum.chat or Slack channel

Please do not post unformatted code into issues, and please do not ask questions. Only real issues, PR's or feature requests are allowed. Minimal reproduction in codesandbox.io is required.

Please provide an explanation of the issue

We are trying to use the onMouseOver and onMouseEnter, how ever with the latest version they do not appear to be working. There is an existing issue that seems to have regressed.

<Marker
        key={createKey(markerProps.position)}
        {...markerProps}
        onClick={() => setIsInfoOpen(!isInfoOpen)}
        onMouseOver={() => useOnHover && setShowHoverTooltip(true)}
        onMouseOut={() => useOnHover && setShowHoverTooltip(false)}
      >
        {(isInfoOpen || showHoverTooltip) && (
          <OverlayView
            key={createKey(markerProps.position)}
            mapPaneName={OverlayView.OVERLAY_MOUSE_TARGET}
            position={markerProps.position}
          >
            {children}
          </OverlayView>
        )}
      </Marker>

Your Environment

os: mac/linux/windows/android/ios

node --version

react version -- "^16.12.0"

webpack version

@babel version

@react-google-maps/api version -- "^2.2.0"

How does it behave?

Mouse events are not firing, click, hover etc.

How should it behave correctly?

When i hover over a marker, it should trigger the mouse over event.

Basic implementation of incorrect behavior in codesandbox.com