Bug fix: Init with marginTop prop or other margin props will turn height to 1 when resize a grid#1441
Closed
deadivan wants to merge 2 commits into
Closed
Bug fix: Init with marginTop prop or other margin props will turn height to 1 when resize a grid#1441deadivan wants to merge 2 commits into
deadivan wants to merge 2 commits into
Conversation
Bug fix: Init with marginTop prop or other margin props will turn height to 1 when resize a grid
Update gridstack.ts
adumesny
reviewed
Nov 5, 2020
| } | ||
|
|
||
| //without this.opts.margin, getMargin method will return undefined, and affect resize behavior | ||
| if(!this.opts.margin) this.opts.margin = Math.round((this.opts.marginTop + this.opts.marginBottom) / 2); |
Member
There was a problem hiding this comment.
this isn't the right fix because margin=0 is a valid value. Thanks for bringing this issue up, will fix it the proper way next...
adumesny
added a commit
to adumesny/gridstack.js
that referenced
this pull request
Nov 5, 2020
* better fix than gridstack#1441 - thanks for suggestion! * when reisizng we incorrectly use getMargin() which is correctly 'undefined' if all 4 sides don't match (should had bee using top+bottom but actually doesn't need any margin, like horizontal) * fiuxed test cases to check for these scenarios
3 tasks
Member
|
thanks for the suggestion! but ended up checking a correct fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Bug fix: Init with marginTop prop or other margin props will turn height to 1 when resize a grid
Checklist
yarn test)