我如何处理来自 GWT 中文本框清除图标的事件?

How do I handle the event from the TextBox clear icon in GWT?

我有一个 GWT TextBox 用作过滤器,可以立即响应添加到其中或从中删除的文本。我的问题是 IE10 中 TextBox 末尾的小 x 清除了 TextBox 中的所有文本。我还没有找到触发了什么事件以及如何像使用 KeyUp 或 Blur 处理程序一样捕获它。

使用 onBrowserEvent 我可以看到 MouseUp 事件通过,但 MouseUpHandler 从未被触发。即使将我想要触发的代码直接放在 onBrowserEvent 调用中也无济于事。

点击 X 会触发 'input' 事件。

所以捕获它的一种方法是将输入事件下沉到文本框并覆盖 onBrowserEvent

TextBox box = new TextBox(){
    @Override
    public void onBrowserEvent(Event event)
    {
        super.onBrowserEvent(event);
        if("input".equals(event.getType()))
            do something
    }
};
box.sinkBitlessEvent("input");