Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#6105 closed bug (fixed)

Upgrade Guide: disableSelection does not prevent anymore focus losses on IE8.

Reported by: benjamin.neau Owned by:
Priority: minor Milestone: 1.8.5
Component: [meta] ui.docs Version: 1.8.5
Keywords: disableSelection, selection, IE8, focus Cc:
Blocked by: Blocking:

Description (last modified by Scott González)

Focus losses were prevented by the "unselectable" attribute set to "on" on dom elements which were set as unselectable. I do not know whether this was an intended feature or merely a side effect.

Nevertheless, the behavior changed, and it at least ought to be in the upgrading guide http://jqueryui.com/docs/Upgrade_Guide/1.8.5.

Thanks for your time and consideration.

Attachments (1)

test.htm (830 bytes) - added by benjamin.neau 9 years ago.

Download all attachments as: .zip

Change History (9)

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

Description: modified (diff)

Can you please explain this in more detail. I'm not sure what you mean by "focus losses".

Changed 9 years ago by benjamin.neau

Attachment: test.htm added

comment:2 Changed 9 years ago by benjamin.neau

Scott,

First and foremost, thanks for taking an interest in the issue I've encoutered.

I've added a simple "test" page to explain the problem I'm trying to describe. On this test page, there should be a textbox and two divs, each of them colored in a different way. Both are first going through a "disableSelection" operation (from jQuery UI Core).

But then, the yellow div (which I named "notrap", whereas the red one is named "trap") is given an additionnal attribute: "unselectable" is set to "on".

After the html page is loaded, I also bind an event handler on the textbox, for when it gains or loses focus, it should update which of the current document element active, should there be one (using document.activeElement). Then a focus event is manually triggered on the textbox.

You shall notice that if you click the red div (trap), the document.activeElement is updated to the red div, whereas if I click on the yellow one, it remains still as the textbox.

I'm using IE 8.0.6001.18702IC on Windows XP SP3, by the way, but I think the issue might be pretty much the same on the other versions of IE 8 (the ones which are not under Windows XP). I have no idea whether it happens on other browsers, for I haven't given it any consideration.

comment:3 Changed 9 years ago by benjamin.neau

Oh by the way, I didn't include jQuery or jQuery UI core javascript files, for they're fairly simple and common to obtain. The versions I've been using are not minimified and taken from the SVN tag you put up a few days ago.

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

Resolution: invalid
Status: newclosed

You'll notice that your test won't work the same in other browsers. The unselectable attribute in non-standard and not something we want to mimic. The fact that .disableSelection() used that functionality should be considered a bug, .disableSelection() has probably been broken for as long as it's be in existence. The behavior defined by preventing the default action of the selectstart event is exactly the behavior we intended .disableSelect() to have.

The current behavior is correct for browsers that support selectstart, and much closer to the correct behavior in browsers that don't.

comment:5 Changed 9 years ago by Scott González

Resolution: invalid
Status: closedreopened

Re-opening to update the Upgrade Guide as noted by Benjamin.

comment:6 Changed 9 years ago by Scott González

Component: ui.core[meta] ui.docs
Milestone: TBD1.9
Resolution: fixed
Status: reopenedclosed
Summary: disableSelection does not prevent anymore focus losses on IE8.Upgrade Guide: disableSelection does not prevent anymore focus losses on IE8.

Updated the Upgrade Guide.

comment:7 Changed 9 years ago by benjamin.neau

Thanks for closing the issue.

comment:8 Changed 9 years ago by Scott González

Milestone: 1.91.8.5
Note: See TracTickets for help on using tickets.