Ticket #5723 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

disableSelection() doesn't work cross-browser

Reported by: andreinjquery Owned by:
Priority: minor Milestone: 1.8.5
Component: ui.core Version: 1.8.2
Keywords: Cc:
Blocking: Blocked by:


I have a drag & drop row reordering in a table, but in Chrome the disableSelection() does not seem to work and the table will be selected as the user drags the mouse to another row.

To resolve this I changed the following line in disableSelection()...

.css('MozUserSelect', 'none');

... to ...

.css({'MozUserSelect': 'none', 'WebkitUserSelect': 'none'});

This seemed to fix the problem.

Change History

comment:1 Changed 5 years ago by andreinjquery

enableSelection() needs to be changed as well to:

.css({ 'MozUserSelect': '', 'WebkitUserSelect': '' });

comment:2 Changed 5 years ago by steida

There is also another bug. Internet Explorer needs attribute also on all children elements, if any. For example: <p>foo bla <b>bar</b>bla bla<p> Setting attribute unselectable on paragraph is not enough.

comment:3 Changed 5 years ago by joern.zaefferer

See also #5798.

comment:4 Changed 5 years ago by scott.gonzalez

  • Summary changed from disableSelection() also needs 'WebkitUserSelect' set to none to disableSelection() doesn't work cross-browser
  • Milestone changed from TBD to 1.9

comment:5 Changed 5 years ago by scott.gonzalez

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in  16e93d5.

comment:6 Changed 5 years ago by scott.gonzalez

...and completely rewritten and simplified in  5de8ced.

comment:7 Changed 5 years ago by scott.gonzalez

  • Milestone changed from 1.9 to 1.8.5

comment:8 Changed 5 years ago by benjamin.neau

...and changing a behavior well established since many versions in the process as reported in #6105.

comment:9 Changed 5 years ago by Scott González

Core: Fixed .disableSelect() and .enableSelect() in all browsers. Fixes #5723 - disableSelection() doesn't work cross-browser.

Changeset: 16e93d5189a5aed10df23e85b5d40b14d126eede

Note: See TracTickets for help on using tickets.