fnagel/jquery-ui — Issue #209: Patch for _refreshPosition issue in IE8
Author: tschettler
Created: 2012-01-12 18:40:51+00:00
State: open

In _refreshPosition and in very specific instances, the call to the position() jQuery UI function will double the listWrap's current top and left inline style values. This causes IE to throw the "can't move focus to control..." error and will not display the dropdown. After spending ~10 hours debugging the issue, I'm not sure if the problem is within the selectmenu plugin or in the position ui component, but this fixes it:

this.listWrap
.removeAttr('style')
.zIndex(this.element.zIndex() + 1)
.position({
// set options for position plugin
of: o.positionOptions.of || this.newelement,
my: o.positionOptions.my,
at: o.positionOptions.at,
offset: o.positionOptions.offset || _offset,
collision: o.positionOptions.collision || o.style == "popup" ? 'fit' : 'flip'
});

This happens to the listWrap element (class ui-selectmenu-menu) on the position() call when you call selectmenu() after the menu is initialized. If the style attribute is removed, the doubling does not occur (nor does the IE8 error). I'm calling this a patch, because it is a workaround for the real issue, which I cannot figure out. I can get it to happen 100% of the time in IE8 on a page I'm developing, but have been unable to create a jsFiddle for it.

*jQuery 1.7.1, jQuery UI 1.8.17, and the latest selectmenu build*

Travis