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

HTML dnd check for setup ddResizable before enable/disable #1506

Merged
merged 1 commit into from
Dec 2, 2020

Conversation

infime
Copy link
Contributor

@infime infime commented Dec 1, 2020

Description

Handle ddResizable enable/disable just like ddDraggable. Fixes #1505

Checklist

  • Created tests which fail without the change (if possible)
  • All tests passing (yarn test)
  • Extended the README / documentation, if necessary

@@ -24,7 +24,7 @@ export class GridStackDDNative extends GridStackDD {
public resizable(el: GridItemHTMLElement, opts: DDOpts, key?: DDKey, value?: DDValue): GridStackDDNative {
this._getDDElements(el).forEach(dEl => {
if (opts === 'disable' || opts === 'enable') {
dEl.ddResizable[opts]();
dEl.ddResizable && dEl.ddResizable[opts]();
Copy link
Member

Choose a reason for hiding this comment

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

hey I don't think this is right as is will not call enable if never created... which it needs to. Also move would need same fix.
if you look at the jquery version I force create for enable, and skip for disable/destroy
if (opts === 'enable') {
$el.resizable().resizable(opts);
} else if (opts === 'disable' || opts === 'destroy') {
if ($el.data('ui-resizable')) { // error to call destroy if not there
$el.resizable(opts);
}
}

@adumesny
Copy link
Member

adumesny commented Dec 2, 2020

thanks for the effort! let find a reproduceable case and I will fix it!

@adumesny adumesny closed this Dec 2, 2020
@adumesny adumesny reopened this Dec 2, 2020
@adumesny
Copy link
Member

adumesny commented Dec 2, 2020

taking this as partial fix. better one coming next.

@adumesny adumesny merged commit 1385b56 into gridstack:develop Dec 2, 2020
@infime infime deleted the fix-h5-resizable-tgl branch December 2, 2020 15:44
@infime
Copy link
Contributor Author

infime commented Dec 2, 2020

@adumesny thanks!

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.

3.0.0 HTML5 drag'n'drop initial GridStack.enable() Error
2 participants