Skip to main content

Search and Top Navigation

#5723 closed bug (fixed)

Opened June 11, 2010 11:10PM UTC

Closed August 27, 2010 04:02PM UTC

Last modified November 19, 2010 06:26PM UTC

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:
Blocked by: Blocking:

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.

Attachments (0)
Change History (9)

Changed June 11, 2010 11:14PM UTC by andreinjquery comment:1

enableSelection() needs to be changed as well to:

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

Changed July 01, 2010 08:06PM UTC by steida comment:2

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.

Changed July 30, 2010 11:47AM UTC by jzaefferer comment:3

See also #5798.

Changed August 27, 2010 04:02PM UTC by scottgonzalez comment:4

milestone: TBD1.9
summary: disableSelection() also needs 'WebkitUserSelect' set to nonedisableSelection() doesn't work cross-browser

Changed August 27, 2010 04:02PM UTC by scottgonzalez comment:5

resolution: → fixed
status: newclosed

Fixed in 16e93d5.

Changed September 01, 2010 01:52PM UTC by scottgonzalez comment:6

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

Changed September 10, 2010 05:26PM UTC by scottgonzalez comment:7


Changed September 23, 2010 07:18PM UTC by benjamin.neau comment:8

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

Changed November 19, 2010 06:26PM UTC by Scott González comment:9

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

Changeset: 16e93d5189a5aed10df23e85b5d40b14d126eede