#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)
Change History (6)
Changed 13 years ago by
Attachment: | testslide.html added |
---|
comment:1 Changed 13 years ago by
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
Component: | manipulation → effects |
---|---|
Milestone: | 1.4.3 |
Priority: | → low |
Status: | new → open |
Confirmed (exists with 1.4.4git)
comment:3 Changed 12 years ago by
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.
comment:4 Changed 12 years ago by
Milestone: | → 1.next |
---|---|
Resolution: | → duplicate |
Status: | open → closed |
Demo of bug