-
-
Notifications
You must be signed in to change notification settings - Fork 535
feat: add v4's float
effect (follow mouse position)
#861
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
Conversation
float
effect (follow mouse position)float
effect (follow mouse position)
For sure. I just meant instead of v4's
It'll probably not be too hard to add a minimum distance between the tooltip border and the arrow position. |
- [ ] disableInternalStyle - **Deprecated** | in V5 -> CSS will be a separate file and can be imported or not | ||
- [x] `children` | ||
- [x] `place` - also available on anchor element as `data-tooltip-place` | ||
- [ ] `type` - use `variant`. also available on anchor element as `data-tooltip-variant` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having both the empty brackets [ ]
and **Deprecated**
seemed redundant.
src/components/Tooltip/Tooltip.tsx
Outdated
if (float) { | ||
if (lastFloatPosition) { | ||
/* | ||
Without this, changes to `content`, `place`, `offset`, ..., will only | ||
trigger a position calculation after a `mousemove` event. | ||
|
||
To see why this matters, comment this line, run `yarn dev` and click the | ||
"Hover me!" anchor. | ||
*/ | ||
handleTooltipPosition(lastFloatPosition) | ||
} | ||
// if `float` is set, override regular positioning | ||
return () => null | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future reference!
TODO
float: boolean
prop to addmousemove
event listener (is there really a need for aneffect: 'solid' | 'float'
prop?)place
valuehandleShowTooltip()
should also use virtual element whenfloat
istrue