Callback is raised before objects are shown with fadeIn() and jQuery.fx.off = true
|Reported by:||dan@…||Owned by:||timmywil|
With animations disabled, $('#object').fadeIn(500, callback) calls the user sent callback function before actually showing the object in the DOM.
Example: See jsFiddle at http://jsfiddle.net/kf4vu/22/
With animations enabled, the callback is raised correctly (ex: same code but with animations on , http://jsfiddle.net/yhECL/).
Furthermore, the callback works as expected using .show, ( $('#obj').show(callback) ) with animations either on or off, so this seems to be strictly a fadeIn/fadeOut/similar animations issue.
This causes many issues, especially when trying to .focus() an input field; if the callback is called before the parent element is shown, it doesn't focus (ex: http://jsfiddle.net/bDgav/1/), and jQuery docs even say that IE will throw an error (calling .focus() on hidden element).
This is only an issue with animations off ( jQuery.fx.off = false ), and works as expected with animations on.
Change History (12)
comment:2 Changed 5 years ago by timmywil
- Component changed from unfiled to effects
- Priority changed from undecided to high
- Status changed from new to open
comment:4 Changed 5 years ago by timmywil
- Owner set to timmywil
- Status changed from open to assigned
comment:11 Changed 4 years ago by gnarf
- Resolution set to fixed
- Status changed from assigned to closed