> From: thebrianschott
> 
> I tried your test copy and focus worked fine.
> 
> I don't see any "extra timeout" in your test copy. I did a 
> diff with your code and mine and the only difference was 
> yours had a couple of blank lines that mine doesn't have. Did 
> I miss something? Where is the extra timeout?

Something went wrong with your diff - maybe the wrong files?

> My two forms output to different processes, and I have been 
> testing only on the iwform for now. I think I could have just one
> openInfoWindowForm() function by adding parameters.

Hmm... You *have* just one openInfoWindowForm() function, used by both of
your forms. Get a working diff and you'll see it.

> I am running on a very slow Mac, btw.
> 
> I am noticing a peculiar behavior on my Mac.
> In Firefox, I do not get focus still, until I Cmd-Tab away 
> from Firefox and the Cmd-Tab back; when I come back, no 
> matter how quickly I do it, I do get the focus I want 
> (Cmd-Tab is like alt-tab on PC's).
> The same behavior works for Cmd-` and again Cmd-` (Cmd-` goes 
> to another open window in the same application).
> 
> The Cmd-Tab behavior does nothing on my Mac in Safari.

One thing to try for test purposes is to make the timeout unreasonably long,
just to see if that's the problem. I set the timeout in openInfoWindowForm()
to 100 ms. Try 5000 ms (five seconds) and see what happens.

That doesn't mean you'd use that long timeout in production, it's just to
help determine why it isn't setting the focus on your machine.

If the longer timeout fixes it, then I'd try to determine what actual
condition should be tested so the timeout isn't necessary. For example,
whenReady() just check that document.getElementById() succeeds on the
element. Maybe it also needs to check that:

1) The element and all of its parent elements are visible

2) The element is a child or descendant of a specific element - in this case
the map container.

Or, keeping it simpler, maybe it turns out that a somewhat longer timeout
works on all machines, maybe 250 ms or some such. Experiment with it and see
what happens.

Also, to help you prioritize this vs. your other tasks, remember that no one
will beat you up if the focus doesn't get set. Most people are going to
click in the box anyway, *even if you set the focus*. They know that many
websites don't set the focus, and rather than figure out which ones set it
and which ones don't, they simply click in the box every time.

-Mike


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to