Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tooltip): Add anchor param to showTooltipFromEvent type #1420

Merged
merged 1 commit into from
Apr 21, 2021

Conversation

nigellima
Copy link
Contributor

Using the tooltip hook showTooltipFromEvent it only allows two parameters, but in the function definition it actually receives the anchor. So, in order to the TS compilation works I had to do the following:

showTooltipFromEvent(
      content,
      event,
      // eslint-disable-next-line @typescript-eslint/ban-ts-comment
      // @ts-ignore
      'left',
    );

So, I added the anchor param to the TooltipActionsContextData, which now is:

showTooltipFromEvent: (content: JSX.Element, event: MouseEvent, anchor?: TooltipAnchor) => void

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0911b41:

Sandbox Source
nivo Configuration
nivo-website Configuration

@wyze wyze changed the title feat(tooltip): Added anchor param definition to showTooltipFromEvent fix(tooltip): Add anchor param to showTooltipFromEvent type Apr 21, 2021
@wyze wyze merged commit 1c2569e into plouc:master Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants