开发者

Right Click menu doesn't show up on Firefox (smartgwt)

开发者 https://www.devze.com 2023-04-12 22:23 出处:网络
If have a Canvas wit开发者_开发百科h elements on it where a right-click should open a menu for this element. This works fine in IE. In Mozilla it only works as long a no scrollbar is visible. If I sma

If have a Canvas wit开发者_开发百科h elements on it where a right-click should open a menu for this element. This works fine in IE. In Mozilla it only works as long a no scrollbar is visible. If I smallen the window the menu won't show up even though the event is called. I tried the menu.show(), menu.showContextMenu() and menu.showNextTo() method but neither worked. The simple code snippet looks like this. Is there a reason why this is happening?

final Menu appMenu = new Menu();
MenuItem smallItem = new MenuItem("Test");
appMenu.addItem(smallItem);

// Context Menu open
this.addRightMouseDownHandler(new RightMouseDownHandler() {

  @Override
  public void onRightMouseDown(RightMouseDownEvent event) {
      appMenu.show();
      // appMenu.showNextTo(Canvas.this);
      System.out.println("rmb");
      event.cancel();
 }
});


Use canvas.setContextMenu(appMenu).

0

精彩评论

暂无评论...
验证码 换一张
取 消