-
Notifications
You must be signed in to change notification settings - Fork 843
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
Update calculatePopoverPosition to seek the position with the largest amount of visible surface area of the popover. #550
Update calculatePopoverPosition to seek the position with the largest amount of visible surface area of the popover. #550
Conversation
1582230
to
48e7f74
Compare
… amount of visible surface area of the popover.
90a6de5
to
263dd95
Compare
- Fix mistakes with calculating height and width differences. - Remove calculatePopoverStyles.
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.
/** | ||
* Determine the best position for a popup that avoids clipping by the window view port. | ||
* Determine the best position for a popover that avoids clipping by the window view port. |
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.
Looks like this comment get detached from the function it describes.
c1cc5d5
to
b72356f
Compare
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.
lgtm
Woo! Thanks @cjcenizal! 🥇 |
Fixes #545
The original logic for this method found the position with the least amount of overflow in a single direction, but for the optimal UX it needs to consider how much total surface area of the popover is being clipped, and choose the position where as much of the popover is visible as possible.