Skip to content

Conversation

irmakyz
Copy link
Contributor

@irmakyz irmakyz commented Dec 22, 2022

No description provided.

@irmakyz irmakyz requested review from Navas23, dletran and fofi December 22, 2022 01:10
@vercel
Copy link

vercel bot commented Dec 22, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
design-system ✅ Ready (Inspect) Visit Preview Dec 22, 2022 at 1:10AM (UTC)

const fitsBelow = popupRect.height < availableHeightBelow
const fitsAbove = popupRect.height < availableHeightAbove
if (fitsAbove && (containerRect.top + availableHeightAbove > viewport.height)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

what does this condition mean? let's try to include the second part (containerRect.top + availableHeightAbove > viewport.height) in a constant so it's easier to read

Copy link
Contributor

Choose a reason for hiding this comment

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

should we make this check for the 4 sides? top, bottom, left and right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes i think i need to add for bottom side as well. this is a condition that if the popup is higher then the container and excessing the end of screen, it detects and making the popup smaller and handles the translation

Copy link
Contributor Author

@irmakyz irmakyz Dec 22, 2022

Choose a reason for hiding this comment

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

  • include second part in the constant
  • check it for 4 sides

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.

2 participants