Skip to main content

Bug Tracker

Side navigation

#6767 closed bug (duplicate)

Opened July 05, 2010 04:08PM UTC

Closed April 17, 2011 08:16PM UTC

Last modified March 13, 2012 10:27PM UTC

Using focus() after slideDown() causes element to disappear in IE6 & IE7

Reported by: Alistair Owned by:
Priority: low Milestone: 1.next
Component: effects Version: 1.4.2
Keywords: sliding Cc:
Blocked by: Blocking:
Description

A slideDown() is executed on a DIV element surrounding an INPUT element. Within the slideDown callback function, the INPUT element is given focus with the focus() method. At that point the element disappears. If the focus() is not done, the slidedown works ok and the element remains visible.

The fix is to use .get(0).focus() instead of .focus(). That is, use the DOM's focus method directly instead of jQuery's. When this is done, the problem does not occur and the element remains visible.

Complete demo HTML is here: http://tinypaste.com/6c8ae

Occurs in IE6 and 7. Seems ok in IE8.

Attachments (1)
  • testslide.html (2.0 KB) - added by Alistair July 05, 2010 04:10PM UTC.

    Demo of bug

Change History (5)

Changed July 05, 2010 04:26PM UTC by Alistair comment:1

I also found that, in the attached demo HTML, if you remove the "float:left" from the style ".fldcol", then the problem goes away.

So perhaps it's something related to adjacent floats in IE7.

Still, it's unusual that the .focus() method causes/triggers the problem, not the slideDown() itself.

Changed October 29, 2010 04:50PM UTC by rwaldron comment:2

component: manipulationeffects
milestone: 1.4.3
priority: → low
status: newopen

Confirmed (exists with 1.4.4git)

Changed March 28, 2011 07:54AM UTC by tomgrohl comment:3

Tested this using 1.5.1 and still doesn't work.

Although this isn't a jQuery bug though, its a IE Css bug.

If you have an element with margin then you need to add display: inline or inline-block otherwise the elements position gets messed up.

I added display: inline-block to the css and it works fine (Tested in IE 6 and 7.

http://jsfiddle.net/tomgrohl/BbvtF/

Changed April 17, 2011 08:16PM UTC by timmywil comment:4

milestone: → 1.next
resolution: → duplicate
status: openclosed

Changed April 17, 2011 08:16PM UTC by timmywil comment:5

Duplicate of #3260.