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

[@mantine/core] Floating Tooltip: position bug at the extremeties #1219

Merged
merged 15 commits into from
Apr 10, 2022

Conversation

wes337
Copy link
Contributor

@wes337 wes337 commented Apr 10, 2022

Moves the positioning of the tooltip logic inside the floating tooltip, rather than the Popper component.

Resolves #1126

@rtivital
Copy link
Member

I think Popper should be removed entirely from there, since it does not really do anything

@wes337
Copy link
Contributor Author

wes337 commented Apr 10, 2022

Yeah, that's true. I'll do that then.

Edit: Well, it looks like Popper still handles the transition, transition duration, zIndex, and handling the withinPortal prop. But do you want these things written into the FloatingTooltip component itself?

return {
left: x || 0,
top: y || 0,
};
}
}, [x, y]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would adding the positionDependencies prop to the dependency array here effectively be the same?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not really know, never dug deep into FloatingTooltip component as it was contributed. If it works, then it's fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I contributed it after all! So I guess I know best then 😄?!

I added it back, and spread it into the dependency array, so the position will be recalculated if one of those dependencies changes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, let's hope that it will fix it then

@wes337 wes337 requested a review from rtivital April 10, 2022 10:36
@rtivital rtivital merged commit c0fa80c into mantinedev:master Apr 10, 2022
@rtivital
Copy link
Member

Thanks!

@wes337 wes337 deleted the MN1126 branch April 10, 2022 12:21
@carledwardfp
Copy link

Thanks for the fix guys!

rtivital pushed a commit that referenced this pull request Apr 16, 2022
* [@mantine/hooks] use-fullscreen: custom ref state (#1212)

* [@mantine/hooks] use-fullscreen: custom ref state

Added a check to ensure a custom ref element toggles the fullscreen state

* fixed the prettier issue

* [@mantine/core] FloatingTooltip: Fix position bugs at the extremeties (#1219)

* [@mantine/core] Select: only use open/close callback when value changes

* [@mantine/core] Select: do not use early return

* [@mantine/core] Tooltip: floating tooltip positioned inside component instead of popper

* [@mantine/core] Tooltip: revert positions story back

* [@mantine/core] Tooltip: remove popper from floating tooltip

* [@mantine/core] Tooltip: fix floating tooltip test, add position deps to coordinates array

* [@mantine/core] Tooltip: remove extra div

* [@mantine/nprogress] Init

* Fix all review issues

* Switch from context api to event

* Add docs

* Updated prop names and fixed some bugs

* Added reducedMotion

* Updated interval

Co-authored-by: Elton Gonçalves Gomes <eltongonc@gmail.com>
Co-authored-by: Wesley Moses <wesmoses@gmail.com>
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.

FloatingTooltip position bugs on elements at the extremeties
3 participants