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

如果FocusPanel在GWT PopupPanel上(仅在Chrome和Safari中),鼠标滚轮事件不会在GWT FocusPanel上触发,gwt,Gwt,代码如下: public class MyEntryPoint implements EntryPoint { PopupPanel popupPanel = new PopupPanel(false,true); FocusPanel focusPanel = new FocusPanel(); VerticalPanel popupContent = new VerticalPanel(); public void onModule

代码如下:

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应用程序,将鼠标移动到文本简单弹出测试上并滚动鼠标滚轮,则会调用onmouseheel

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


也许有人已经纠正了这一点?非常感谢。

可以在GWT问题追踪器上找到该漏洞:

在问题文本中有一个指向Google goups讨论的链接

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

是的,这很有帮助:非常感谢。