Opened 13 years ago
Closed 13 years ago
#8482 closed defect (wontfix)
Using dijit.focus() in conjuntion with wipeIn() race condition
Reported by: | coldfire22x | Owned by: | dante |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | fx | Version: | 1.2.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
When calling dijit.focus() on a dijit.form.TextBox? from within the onEnd handler of dojo.fx.wipeIn(), the TextBox? is focused and can immediately accept input but the blinking cursor does not appear. The result is that it's not immediately clear to the user that he/she can begin entering input into the TextBox? (subjective, of course).
It appears to be a race condition that specifically affect Firefox 3. The problem does not exist in IE6. Have not tested in other environments.
Attachments (3)
Change History (5)
Changed 13 years ago by
Attachment: | without_animation.txt added |
---|
Changed 13 years ago by
Attachment: | with_animation.txt added |
---|
Demonstration of non-working example with animation
Changed 13 years ago by
Attachment: | with_animation_and_timeout.txt added |
---|
Demonstration of how setTimeout beats the race condition
comment:1 Changed 13 years ago by
Milestone: | tbd → 1.4 |
---|---|
Owner: | changed from Bryan Forbes to dante |
Status: | new → assigned |
comment:2 Changed 13 years ago by
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
so I'm not sure there is much (if anything) we can do about this. It seems a stack issue with defining the onEnd as part (inside) of the Animation declaration. adjusting the "with_fx" example about to do:
var a = dojo.fx.wipeIn({ node:parent, duration:400 }); dojo.connect(a, "onEnd", tb, "focus"); a.play();
(connecting externally rather than within the same 'thread' as the wipeIn call) seems to free the stack up and allow the focus to happen fine. This is ultimately the same as doing the setTimeout(..., 0).
Focus has always been a little odd like this, and while I'd love for this to work the same in all browsers, I can't see calling the animation event callbacks in a timeout being beneficial outside of this edge case. (I didn't test that, just assuming that is what it would take to ensure the stack is 'cleared')
I wish I had a more positive resolution here. Perhaps I'm missing something.
Working example without animation