Repository navigation
Update GridStack when item options change #62
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -65,6 +65,20 @@ export default class extends Component { | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * @method didUpdateAttrs | ||||||
| * @override | ||||||
| */ | ||||||
| didUpdateAttrs() { | ||||||
| super.didUpdateAttrs(...arguments); | ||||||
|
|
||||||
| let parent = this.parentContainer; | ||||||
| if (parent && parent.gridStack) { | ||||||
| let { height, width, x, y } = this.options; | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| parent.gridStack.update(this.element, x, y, width, height); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we do this for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure there is any benefit in adding an exclusion list. It would be nice to remove the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the benefit would be not updating the DOM multiple times (with
Totally agree 👍 I spoke with a gridstack maintainer on slack, looks like direct attribute updates are not officially supported. I filed an issue for this enhancement. Another issue is that not all Given, the need for a larger refactor, I think we can merge this and clean up the flow separately. Thanks for your work on this 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can fix the |
||||||
| } | ||||||
| } | ||||||
|
|
||||||
| /** | ||||||
| * @method didInsertElement | ||||||
| * @override | ||||||
|
|
||||||
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.