react-component / react-component/tooltip

How to configure align offset?

Open
#121 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
944
Forks
199
Avg merge
19h 1m
Merged PRs (30d)
3

Description

I'm a bit confused on how do we set the offsetX and offsetY in the align prop. What I understand is that we can use this align prop to position the tooltip to the target node. But when I pass in a specific value of this, it shows in the browser's development tool that the left and top position of the tooltip element is different. I know the tooltip container is relative to the body but how do we set the align offset properly? I also tried setting getTooltipContainer but I can't still figuring out how to set the position properly. It seems like there area some calculations going on after passing the offset value. Hoping someone can elaborate the use of it.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the align prop uses offsetX and offsetY, including the positioning calculations for the tooltip relative to the body. Check whether getTooltipContainer changes that behavior, then document the configuration and explain the observed left and top values so users can tell when the setup is correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.