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

fix(ModalBasicLayout): fix for logic of when to show modal footer shadow #2665

Conversation

YossiSaadi
Copy link
Contributor

  • Shadow should appear if content is scrollable (even if not scrolled)
  • Shadow should disappear if content is scrolled to the end
  • As we want to be responsive we should observe the resize to not cause a weird behavior

https://monday.monday.com/boards/3532714909/pulses/8075041798

@YossiSaadi YossiSaadi requested a review from a team as a code owner December 18, 2024 16:14
Comment on lines +14 to +16
setScrollable(scrollHeight > clientHeight);
setContentScrolled(scrollTop > 0);
setScrolledToEnd(scrollTop + clientHeight >= scrollHeight);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can these can be optimized to check if the current state is the same as the new one don't update it, as to avoid unnecessary rerenders.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed in person, React is smart for primitive values (in here only booleans)

@YossiSaadi YossiSaadi merged commit 9d68962 into master Dec 19, 2024
13 of 14 checks passed
@YossiSaadi YossiSaadi deleted the fix/yossi/new-modal-shadow-on-basic-modal-should-show-only-if-8075041798 branch December 19, 2024 14:12
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