-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix all positions #2151
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 all positions #2151
Conversation
|
@Parvinmh is attempting to deploy a commit to the Pean Team on Vercel. A member of the Team first needs to authorize it. |
| | "bottom-middle-aligned"; | ||
| | "bottom-middle-aligned" | ||
| | "bottom-right-aligned"; | ||
| export type TooltipPosition = TooltipBasePosition | TooltipAlignment; |
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.
Why are we introducing a new type for this? Why not keep all under the same type?
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.
They’re combined into TooltipPosition for a simple public API, but kept separate for correctness and maintainability.
| ? (containerOrWindow as HTMLElement).clientHeight | ||
| : (containerOrWindow as { width: number; height: number }).height; | ||
| const tW = tooltipWidth + 12; | ||
| const tH = tooltipHeight + 12; |
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.
where number 12 is coming from?
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.
Arrow size (10px): extends beyond tooltip box
Safety margin (2px): prevents touching viewport edges
src/util/getOffset.ts
Outdated
| * @returns Element's position info | ||
| * Returns all scrollable parents up to document root | ||
| */ | ||
| function getScrollParents(el: HTMLElement): HTMLElement[] { |
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.
How this was handled previously?
e331f76 to
ce0a43e
Compare
a2ec7a8 to
77ab5e0
Compare
No description provided.