ducksboard / gridster.js

gridster.js is a jQuery plugin that makes building intuitive draggable layouts from elements spanning multiple columns
http://gridster.net/
MIT License
6.03k stars 1.2k forks source link

Contenteditable="true" with Resize enabled breaks text selection #546

Open AndyWorral opened 9 years ago

AndyWorral commented 9 years ago

I have a grid with items that have elements that are contenteditable="true"

When you turn on resize, gridster registers and event on selectstart that causes highlighting and caret placement to not work in chrome (highlight does in work in ie edge)

I can get it to work by forcefully unbinding the event. Oddly resizing still appears to work.

//sledge hammer approach $('.itemThatISContentEditableAndWasNotWorking').parents('ul').unbind('selectstart');

Is the event required? ( I assume it holds some purpose, but appears to be cancelling the event). Still have to go through the debug code to find it.

daviesgeek commented 8 years ago

The same thing also holds true for resizable widgets without contenteditable. I.e., if I have some text that I want to be able to select inside a widget, it doesn't work unless I unbind the selectstart event. The resize handle still works and all is still functional. Is there any reason why this is necessary to bind and cancel the selectstart event?