On Nov 7, 4:33 am, Open eSignForms <[email protected]> wrote:
> I have a dialog box, with a close button that is given the focus so
> that hitting Enter results in it closing.
>
> That works fine.  In fact, it seems that the Enter actually results in
> a Click event, perhaps because it's a button receiving the key.
>
> But my onClick handler sets the focus on an input TextBox field on the
> form "under it" that cause the error.  This then seems to cause the
> onKeyUp key to fire on that TextBox.  I don't want this since the key
> actually was hit on the dialog box.
>
> If my dialog box doesn't set the focus back, this doesn't seem to
> happen.  But when it does set the focus back, it seems to cause the
> Enter to also be sent to it.
>
> What am I doing wrong?

Probably nothing; it's not clear what browsers should do (and are
doing) when you change the focus during key events' handling
(particularly, when you change focus during keydown or keypress,
should the next keypress and keyup fire on the original target or the
newly focused element? and the same applies somehow for push buttons,
radio buttons, checkboxes and dropdowns; as you've been experiencing).
FYI, this is being discussed at the W3C.

What if you setFocus() in a DeferredCommand? that way, the focus
wouldn't have already been moved when the keyup event fire (so it'd
fire on the button, not the text box)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" 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-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to