Search and Top Navigation
#7735 closed bug (wontfix)
Opened September 23, 2011 06:03AM UTC
Closed October 01, 2011 04:28PM UTC
disableSelection breaks ability to focus text inputs in browsers that don't implement the nonstandard onselectstart
Reported by: | bzbarsky | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.9.0 |
Component: | ui.core | Version: | 1.8.16 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
See https://bugzilla.mozilla.org/show_bug.cgi?id=688599 for the analysis.
In brief, in browsers that don't have the nonstandard onselectstart event (e.g. any Gecko-based browser) using disableSelection() on a node will prevent focusing any text inputs inside the node, since the default action of mousedown on an input is to move the focus to that input but that default action is being prevented.
Presumably you should be checking the event target instead of just blindly preventing all mousedown default actions. Note that you had similar issues in some other browsers (e.g. http://bugs.jqueryui.com/ticket/6080 ) before you started using onselectstart in the UAs that implement it.
Attachments (0)
Change History (4)
Changed September 26, 2011 06:12PM UTC by comment:1
blocking: | → 7737 |
---|
Changed September 26, 2011 06:30PM UTC by comment:2
status: | new → open |
---|
Changed September 26, 2011 06:53PM UTC by comment:3
Well, one obvious option is not having the user-hostile selection-prevention behavior at all...
Past that, -moz-user-select styles seem like your best bet, with exceptions made for all the interactive elements... And that still loses if there's a contenteditable section in there, but there's just no sane way to make that work with the intent of this function.
The User Interface for CSS spec defines user-select. Using -moz-user-select gets us a better implementation, but it's still not perfect. You can focus the input with the mouse, but you can't change where the cursor is within the input using the mouse.
@bzbarsky Other than getting the selectstart event standardized, do you have any ideas for a fully working solution in current Firefox?