Skip to main content

Search and Top Navigation

#6105 closed bug (fixed)

Opened September 23, 2010 07:11PM UTC

Closed September 24, 2010 12:49PM UTC

Last modified October 25, 2010 05:55PM UTC

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

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 (0.8 KB) - added by benjamin.neau September 24, 2010 08:23AM UTC.
Change History (8)

Changed September 23, 2010 07:20PM UTC by scottgonzalez comment:1

description: \ 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.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.

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

Changed September 24, 2010 08:31AM UTC by benjamin.neau comment:2

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.

Changed September 24, 2010 08:32AM UTC by benjamin.neau comment:3

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.

Changed September 24, 2010 12:42PM UTC by scottgonzalez comment:4

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.

Changed September 24, 2010 12:43PM UTC by scottgonzalez comment:5

resolution: invalid
status: closedreopened

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

Changed September 24, 2010 12:49PM UTC by scottgonzalez comment:6

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.

Changed September 24, 2010 03:29PM UTC by benjamin.neau comment:7

Thanks for closing the issue.

Changed October 25, 2010 05:55PM UTC by scottgonzalez comment:8

milestone: 1.91.8.5