Opened 11 years ago

Closed 11 years ago

#7735 closed bug (wontfix)

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: #7737


See 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. ) before you started using onselectstart in the UAs that implement it.

Change History (4)

comment:1 Changed 11 years ago by Scott González

Blocking: 7737 added

comment:2 Changed 11 years ago by Scott González

Status: newopen

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?

comment:3 Changed 11 years ago by bzbarsky

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.

comment:4 Changed 11 years ago by Scott González

Resolution: wontfix
Status: openclosed

We're going to remove .disableSelection(); see #7755.

Note: See TracTickets for help on using tickets.