Reputation: 32912
In Chrome v.25 I use this code to avoid text cursor while dragging HTML element:
document.addEventListener("mousemove",function(e) { e.returnValue = false; });
Every <input type="number"/>
is crippled (see jsfiddle)
I already managed to avoid this by setting the false returnValue only while dragging. But what exactly happens here? Is it a bug or some feature?
Upvotes: 1
Views: 111
Reputation: 5237
You can achieve this with CSS, if I understand what you mean correctly...
.no-select {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
Just add that to the elements that you don't want to be selectable.
This does look like rather a string issue, as I wouldn't call pressing up on a number input a mousemove event, but in any case, the issue exists. The CSS may be a more elegant solution.
Check the fiddle here:
Upvotes: 1