Loading...

jQuery Forum

Chrome text select cursor on drag

by 
 on 24-Sep-2009 05:35 AM.
  in  Using jQuery UI 

Hey guys, i just noticed something, whenever you start to drag on
chrome it changes his cursor to a text select and ignores the option
cursor... is there a fix for that?
the test case can be reproduced on the example page http://jqueryui.com/demos/draggable/
chrome changes the cursor to text select.
  3 users find this useful 

Re: Chrome text select cursor on drag

by 
 on 24-Sep-2009 09:09 AM

Perhaps a CSS setting { cursor:default; } may fix it?
-----Original Message-----
From: jquery-ui@googlegroups.com [mailto:jquery-ui@googlegroups.com] On
Behalf Of Thiago Cruz
Sent: Thursday, September 24, 2009 9:36 AM
To: jQuery UI
Subject: [jquery-ui] Chrome text select cursor on drag
Hey guys, i just noticed something, whenever you start to drag on
chrome it changes his cursor to a text select and ignores the option
cursor... is there a fix for that?
the test case can be reproduced on the example page
http://jqueryui.com/demos/draggable/
chrome changes the cursor to text select.

Re: Chrome text select cursor on drag

by 
 on 24-Sep-2009 09:45 AM
Interesting. Could you file a ticket for this?

http://dev.jqueryui.com/newticket (note: requires registration)

Thanks


i digged a bit more on this and actually there is alredy an open
ticket for that issue
http://dev.jqueryui.com/ticket/4163
it's all about using document.onselectstart = function () { return
false; }
hopefully will be fixed on 1.8

Re: Chrome text select cursor on drag

by 
 on 14-May-2010 03:26 AM
This still seems to be a problem. I was able to find a fix in the ticket, but just to make the answer a little more obvious to anyone with the same question:

Just add
Copy code
  1. document.onselectstart = function () { return false; };

Anywhere in the code seems to do it.

Re: Chrome text select cursor on drag

by 
 on 21-Jun-2010 09:42 AM
Such handler for the whole document will disable text selection for the whole page which probably is not what you want.

It is better to do

Copy code
  1. this.onselectstart = function () { return false; };

on the same DOM element on which you do .draggable(). This will then prevent text selection only for it and selection will still work for the rest of the page.

Re: Chrome text select cursor on drag

by 
 on 19-Jul-2010 12:49 AM
Hi,
 
Is there a any chance to have correct cursor while dragging in Safari/Chrome? I need to preserve text selection as well on draggable elements!

Re: Chrome text select cursor on drag

by 
 on 06-Sep-2010 01:50 PM
The cursor in chrome was fine in version 1.7.2. Here is the link http://viralpatel.net/blogs/demo/jquery-resize-drag/

But in latest version, resize cursor becomes text cursor when dragging....

Re: Re: Chrome text select cursor on drag

by 
 on 06-Sep-2010 05:19 PM
Maybe a CSS solution?
http://stackoverflow.com/questions/826782/css-rule-to-disable-text-selection-highlighting

Balázs Suhajda
frontend developer

Re: Chrome text select cursor on drag

by 
 on 06-Sep-2010 09:59 PM
Thanks Balázs,  your suggestion will be helpful in other case. I bookmarked it.

The earlier posts had a good effective solution
Copy code
  1. this.onselectstart = function () { return false; };

My solution is, add css style to the body tag (cursor: default) when mousedown event on certain element. This way, the code will override default behavior of chrome cursor.

Re: Chrome text select cursor on drag

by 
 on 20-Dec-2010 07:13 AM
Yes,

$(".mydraggable").each(function() {
      this.onselectstart = function() { return false; };
    });


This was the solution!

Thanks
 Back
 Top
Post Actions
Statistics
  • 10
     Replies
  • 5580
     Views
  • 3
     Followers
This discussion is tagged