Ticket #5055 (closed bug: worksforme)
In IE, focussing on newly created elements is erratic
| Reported by: | william_mc | Owned by: | brandon |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.4 |
| Component: | event | Version: | 1.3.2 |
| Keywords: | focus | Cc: | |
| Blocking: | Blocked by: |
Description
If you create an element with jQuery, and attempt a focus, whether it succeeds or not depends on what kind of element previously held focus. The attached code works in IE, but only because the focussing is put in a setTimeout call. Without the setTimeout, it fails. Works fine either way in FF3 and Chrome.
Attachments
Change History
comment:1 Changed 4 years ago by william_mc
Looking at this further, there is another case where IE loses track of who has focus & won't put it back correctly. In the attached file, there are 3 buttons which replace themselves with an input field. The first one doesn't redirect focus properly. The second one does, when clicked. The third one (which initially has focus) does when the return key is pressed, but requires strange and bizarre incantations involving the body keypress handler and moving focus around.
comment:2 Changed 4 years ago by william_mc
sorry, forgot to say that the three-button file is called iebug.html. Why can't you add attachments to changes in the bug tracker?
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

