On Tuesday, March 20, 2012 5:05:52 PM UTC+1, P.G.Taboada wrote:
>
> Hi,
>
> I am running into the issue that I have a complex widget that I have built 
> using lots of html and css. I went down from 10 widgets to one, performance 
> is ok now. But now I need to capture the blur oand focus event of the input 
> widget deep inside my hierarchy.
>
> Yes I know, blur and focus events are not bubbled. What is the best hack 
> to get them anyway?
>

Use DOM.sinkEvents and DOM.setEventListener on the child element on 
'attach' of the widget (and make sure to set the EventListener back to 
'null' on 'detach' or you'll have memory leaks on IE).

The only alternative I can think of would be to use JSNI to add handlers in 
the "capture" phase on the widget's root element; except for IE (at least 
6/7, maybe 8) where you'd use the focusin and focusout events (still using 
JSNI, as addBitlessDomHandler doesn't work on IE, on-purpose)

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/1CxFiet-VdgJ.
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