Skip to content

$el.draggable is not a function in v2 #1390

@ritox842

Description

@ritox842

Subject of the issue

After upgrading to version 2.0 I'm getting $el.draggable is not a function for all of my widgets
image

I saw some similar issue #1363
I wasn't able to reproduce it in jsFiddle. Tried to import jquery and jqyertUI and its working so I don't really knows why in my app Im getting this error. For my understanding its an issue with how gridstack grabbing jquery-ui.

While debugging I found that in [this file] (https://github.com/gridstack/gridstack.js/blob/5c421b796faa3d01646bf835b2da3cdd87de6193/src/jq/gridstack-dd-jqueryui.ts) we're taking the element any parsing it with $() that cause it to e an array and therefore draggable is not a function
image

Tried to pass a regular element and an element as a string and getting the same issue

Your environment

  • gridstack 2.0
  • all browsers

Expected behaviour

Widgets should be draggable.

Actual behaviour

Getting error that gridstack's addWidget doesn't recognised $.draggable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions