-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: makeWidget breakpoint layout issue #3071 #3072
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
base: master
Are you sure you want to change the base?
fix: makeWidget breakpoint layout issue #3071 #3072
Conversation
@@ -417,14 +417,14 @@ export class GridStackEngine { | |||
// remember it's position & width so we can restore back (1 -> 12 column) #1655 #1985 | |||
// IFF we're not in the middle of column resizing! | |||
const saveOrig = (node.x || 0) + (node.w || 1) > this.column; | |||
if (saveOrig && this.column < this.defaultColumn && !this._inColumnResize && !this.skipCacheUpdate && node._id && this.findCacheLayout(node, this.defaultColumn) === -1) { | |||
if (saveOrig && this.column < this.defaultColumn && !this._inColumnResize && !this.skipCacheUpdate && !isNaN(node._id) && this.findCacheLayout(node, this.defaultColumn) === -1) { |
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.
good catch!
node._id!==undefined or node._id?? might be less specific
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.
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.
yes please.
src/gridstack.ts
Outdated
@@ -1633,7 +1633,9 @@ export class GridStack { | |||
el.gridstackNode = node; | |||
node.el = el; | |||
node.grid = this; | |||
this.engine._loading = true; // help with collision |
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.
this feels wrong and would have to debug it myself. too low level and could conflict with other proper calls
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.
removed it for now
Description
See #3071 for description of issue. I added setting _loading to true in _prepareElement to fix the order issue and changed how we check if
node._id
is present (previously it would be false when called with the first element as it has an id of 0, not sure if this was wanted)Checklist
yarn test
)