如果FocusPanel在GWT PopupPanel上(仅限Chrome和Safari),则GWT FocusPanel上不会触发鼠标滚轮事件

时间:2012-05-02 13:45:44

标签: gwt

以下是代码:

public class MyEntryPoint implements EntryPoint {

    PopupPanel      popupPanel = new PopupPanel(false,true);
    FocusPanel      focusPanel = new FocusPanel();
    VerticalPanel   popupContent = new VerticalPanel();

    public void onModuleLoad() {

        popupContent.add(new Label("Simple popup test"));
        popupContent.add(new Label("_"));

        focusPanel.add(popupContent);
        popupPanel.setWidget(focusPanel);

        popupPanel.center();

        focusPanel.addMouseWheelHandler(new MouseWheelHandler(){
            public void onMouseWheel(MouseWheelEvent event) {
                System.out.println("deltaY = " + event.getDeltaY());
            }
        });

    }
}

如果您在Firefox中运行GWT应用程序,请将鼠标移到文本“简单弹出窗口测试”上并滚动鼠标滚轮,然后调用onMouseWheel。

如果此应用程序在Chrome或Safari中运行,请将鼠标放在文本“简单弹出窗口测试”上并滚动鼠标滚轮,然后再调用onMouseWheel。如果放置鼠标光标不在GWT标签上并滚动鼠标滚轮,则会在onMouseWheel上调用该事件。

也许有人已经纠正过这个问题?非常感谢你。

1 个答案:

答案 0 :(得分:0)

可以在GWT问题跟踪器上找到Bug:

http://code.google.com/p/google-web-toolkit/issues/detail?id=7349

问题文本中有一个Google goups讨论链接。

我通过将弹出窗口设置为modal = false来解决问题。