Closed
Bug 1128226
Opened 11 years ago
Closed 10 years ago
JQuery disableSelection works differently on FireFox than on Chrome&Safari
Categories
(Core :: Layout: Form Controls, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 1231923
People
(Reporter: light, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36
Steps to reproduce:
see jsfiddle:
http://jsfiddle.net/94w3f81g/1/
Actual results:
On Chrome and Safari you can select the text in the input field
in Firefox, you can't click in the input field, select the text or position the caret
Expected results:
It would be nice if Firefox behaved the same as chrome and safari and allow me to position the caret inside the form field.
Comment 1•10 years ago
|
||
Build ID 20160104030217
User Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:46.0) Gecko/20100101 Firefox/46.0
Hi,
I tested this problem on Mac OS X 10.10 and Ubuntu 15.04, with the latest Nightly 46.0a1 and:
1. Select the text can reproduce
2. Click the input field can't reproduce
3. Position the caret can't reproduce
Status: UNCONFIRMED → NEW
Component: Untriaged → Layout: Form Controls
Ever confirmed: true
Product: Firefox → Core
Version: 33 Branch → Trunk
Whereas it would be lovely for firefox to work the same as Chrome and Safari... I really think Firefox is doing the right thing by not allowing any selection to go on.
Can anyone site chapter and verse from any standards document that defines what the proper behavior should be??
Perhaps the bug should be leveled against Chrome and Safari??
Comment 3•10 years ago
|
||
Not only is there no relevant standards document here, but jQuery itself is actually doing different things in different browsers when you do disableSelection:
disableSelection: (function() {
var eventType = "onselectstart" in document.createElement( "div" ) ?
"selectstart" :
"mousedown";
return function() {
return this.bind( eventType + ".ui-disableSelection", function( event ) {
event.preventDefault();
});
};
})()
The "selectstart" event is nonstandard, though there are attempts to standardize it. It's supported by Chrome and Safari. Support in Gecko is behind the "dom.select_events.enabled" preference so far. This preference is enabled on nightly, which is why ovidiu could not reproduce the problem in comment 1. If jQuery prevented mousedown default action unconditionally, Chrome and Safari would behave the same way Firefox does.
Olli, I don't see a bug tracking turning on selection events outside nightly. Should there be one? Presumably this is a duplicate of that one....
Flags: needinfo?(bugs)
Comment 4•10 years ago
|
||
I don't think we have such bug yet. Let mystor confirm.
Flags: needinfo?(bugs) → needinfo?(michael)
Comment 5•10 years ago
|
||
There is: bug 1231923 :)
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: needinfo?(michael)
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•