I have a div that has been given a tabindex, when the div is focused(click or tabbed to) it does the following:
inserts an input into itself, gives the input focus>
Your problem is likely that you're not appending a DOM object, you're appending explicit HTML to your page -- and I doubt that Safari is updating the DOM behind the scenes.
Try to use the actual DOM methods like document.createElement()
to append your input
to the DOM, as described in a number of places (such as here or here or here), and then see if the Safari problem persists.
All that said, the way that you describe the issue arising -- on clicks but not tabs, for example -- would argue that the problem isn't going to be this... so now I'm curious. (In any event, using DOM methods is really the right way to add elements, so it's not a bad idea to do it anyway.)