amazon
amazon

Reputation: 43

gridstack select content rather than dragging

I am using gridstack to render variable content onto a website. I need to render a table and some text inside the grid element, which works fine so far. BUT I want to allow the user to select portions of the rendered table text or other plain text with copy and paste but gridstack does not allow the selection it just drags the widget. Is there a way to make a handle bar visible and to allow only the dragging when the user selects the handlebar not the content ?

Upvotes: 1

Views: 973

Answers (2)

Stuart Norman
Stuart Norman

Reputation: 1

Add

onMouseDown='event.stopPropagation();'

To any element you don't want to be able to drag with grid stack.

:)

Upvotes: 0

Charlie Olson
Charlie Olson

Reputation: 11

It should work to override the handle selector in the 'draggable' options, e.g:

GridStack.init({
  draggable: {
    handle: '.your-handle-class',
  }
});

https://github.com/gridstack/gridstack.js/tree/develop/doc#updateel-gridstackelement-opts-gridstackwidget

Upvotes: 1

Related Questions