I am working on a site that loads an iframe (from another domain) when a user types in a text box.
Sometimes an iframe loads a site that steals focus. This is especially annoying as the user will type in the text box and will now enter the iframe text box.
There seems to be no way to disable the iframe from stealing focus. To mitigate this, I am trying to find a reasonable way to find out when to redirect my text box. He has a rather big headache. The main reason this sucks is that I cannot understand the way the text box was blurred intentionally, unlike an iframe stolen by focus.
This is how much I got, but I need help:
var my_textbox = $("#my_textbox"); var iframe = $("#iframe"); var enableBlur = true; my_textbox.blur(function(){ if (!enableBlur){
Now notice how terrible UX is if you want to intentionally stop typing in the text box. While the iframe loads, you are "locked" into the text box ... you cannot even enter the address bar of your browser.
Any ideas on how to improve this? I hope that I am missing something completely obvious, but I'm sure not.
As always, thanks for the help.
source share