Handling HTML5 browser events

I have a need to listen to a mobile browser compositionEnd event. In my case, this event fires in a text box (or text portion of a combo box) when a user uses a phone keyboard speech-to-text function to enter text in the input. On iOS, this action does not fire a keyUp event, so a combo box doesn’t know the input has changed, and thus doesn’t update the displayed filtered item list.

I see that Vaadin 8 includes the GWT Elemental library, but I can’t figure out how to build a custom component based on ComboBox or something else that registers a handler for an event not defined by core GWT. Any help would be appreciated. In my case, I just want a ComboBox derivative that calls filterOptions(0) for compositionEnd events just like it does already for keyUp events.

This is a tough one because compositionEnd event is not known event type by GWT, hence e.g. doing addDomHandler(…) into ComboBox.tb is not working approach. The last resort is to use Event.addNativePreviewHandler(…) in which case you need to check that event is bound to happen in the ComboBox you are interested with event.getNativeEvent().getEventTarget() and you need to know the integer value of compositionEnd event, so that you can check if it matches event.getTypeInt(). This should work if compositionEnd triggers native preview handler in the first place. If not, then you are out of luck I think.