react-simple-maps icon indicating copy to clipboard operation
react-simple-maps copied to clipboard

sandbox for the Tooltip example on website is not working

Open scho3034 opened this issue 2 years ago • 7 comments

Example sandbox of tooltip is not working. https://www.react-simple-maps.io/examples/map-chart-with-tooltip/

scho3034 avatar Jan 10 '23 21:01 scho3034

change on sandbox de import ReactTooltip for import { Tooltip as ReactTooltip } from 'react-tooltip';

santimone avatar Jan 15 '23 00:01 santimone

Even then, I think v5 react-tooltip works quite differently so would need a new example beyond the above change.

bnbon avatar Jan 15 '23 02:01 bnbon

The easy fix is to update the CodeSandbox to use [email protected], instead of react-tooltip@latest.

The other alternative is to update the example to cover the new version (v5). If anyone decides to take that on, and changes to react-tooltip would make it easier somehow, I'd be willing to help as one of the maintainers of react-tooltip.

gabrieljablonski avatar Jan 17 '23 20:01 gabrieljablonski

@gabrieljablonski There is one other issue with using react-tooltip v5. The tooltip does not display on top of the marker. Instead it displays below in the div, but using v4 or below it displays properly on top of the marker.

scho3034 avatar Jan 17 '23 20:01 scho3034

@gabrieljablonski There is one other issue with using react-tooltip v5. The tooltip does not display on top of the marker. Instead it displays below in the div, but using v4 or below it displays properly on top of the marker.

That sounds like something that would happen if you're not doing import "react-tooltip/dist/react-tooltip.css";.

If that's not the case, please open an issue over there with sample code, preferably a CodeSandbox, demonstrating the problem.

gabrieljablonski avatar Jan 17 '23 20:01 gabrieljablonski

@scho3034 you should probably keep this issue open, since the example on the website still needs to be fixed.

gabrieljablonski avatar Jan 17 '23 20:01 gabrieljablonski

@gabrieljablonski even adding the CSS import, the content is still displayed below the map. To get the desired effect the float option needs to be added to the Tooltip, that way it's always displayed below the mouse.

Here is a codesandbox with a working tooltip.

Tokelin avatar Jan 27 '23 12:01 Tokelin