Bug Tracker

Opened 13 years ago

Closed 12 years ago

Last modified 11 years ago

#6767 closed bug (duplicate)

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 13 years ago.
Demo of bug

Download all attachments as: .zip

Change History (6)

Changed 13 years ago by Alistair

Attachment: testslide.html added

Demo of bug

comment:1 Changed 13 years ago by Alistair

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.

comment:2 Changed 13 years ago by Rick Waldron

Component: manipulationeffects
Milestone: 1.4.3
Priority: low
Status: newopen

Confirmed (exists with 1.4.4git)

comment:3 Changed 12 years ago by tomgrohl

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/

comment:4 Changed 12 years ago by Timmy Willison

Milestone: 1.next
Resolution: duplicate
Status: openclosed

comment:5 Changed 12 years ago by Timmy Willison

Duplicate of #3260.

Note: See TracTickets for help on using tickets.