8000 Avoid reflows via explicitly setting minRow by lmartorella · Pull Request #3054 · gridstack/gridstack.js · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Avoid reflows via explicitly setting minRow #3054

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lmartorella
Copy link
Contributor

Description

If gridstack is used in a complex layout, the browser layout can be interrupted by a reflow when the getComputedStyle function is called to ask for parent min-height.

image

To mitigate this in the _updateContainerHeight, it could be possible to give a priority if both minRow option and the min-height CSS property of the parent div are set. In this way, applications that sets minRow programmatically would never trigger the reflow.

Since 0 is the default value, and null/undefined values can be tricky to manage due to falsy/truly check in JS, to I would say that checking a non-zero/non-null value would be the solution. Users that wants "0" to be a valid row count and still disable the CSS check, could be pass something like -1 to obtain the same result.

Thanks, L

Checklist

  • [N/A] Created tests which fail without the change (can't find a test for the min-height CSS prop, please let me know if you would like to have this tested)
  • All tests passing (yarn test)
  • Extended the README / documentation, if necessary

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.

1 participant
0