Results 1 to 8 of 8

Thread: [1.2.4] Tooltip is hiding context menu

  1. #1
    Ext User
    Join Date
    Jun 2008
    Posts
    365
    Vote Rating
    0
      0  

    Default [1.2.4] Tooltip is hiding context menu

    Hosted mode
    Windows XP
    GWT 1.5.3
    GXT 1.2.4 (maybe also 2.0?)

    When you set a context menu and a tooltip on a component and you right click on the component, the tooltip is partially hiding the context menu.

    Code:
    public class TestToolTipAndMenu implements EntryPoint {
    
        public void onModuleLoad() {
            DataList list = new DataList();
            DataListItem item = new DataListItem("My item");
            item.setToolTip("My item tooltip");
            list.add(item);
            Menu menu = new Menu();
            menu.add(new MenuItem("My menu item"));
            list.setContextMenu(menu);
            RootPanel.get().add(list);
        }
    
    }
    I don't know if this is the cleaner way to fix it, but you could hide the tooltip when you show the context menu. In Component :
    Code:
      protected void onShowContextMenu(int x, int y) {
        hideToolTip();
        contextMenu.showAt(x, y);
        if (contextMenu.isVisible()) {
          contextMenu.addListener(Events.Hide, new Listener<ComponentEvent>() {
            public void handleEvent(ComponentEvent ce) {
              contextMenu.removeListener(Events.Hide, this);
              onHideContextMenu();
            }
          });
          disableBrowserEvents = true;
        }
      }

  2. #2
    Ext User
    Join Date
    Jun 2008
    Posts
    365
    Vote Rating
    0
      0  

    Default

    My fix won't work. In the sample, the context menu is a data list attribute while the tooltip is a data list item attribute.

  3. #3
    Ext User
    Join Date
    Jun 2008
    Posts
    365
    Vote Rating
    0
      0  

    Default

    As a workaround, I do :
    Code:
            contextMenu.addListener(Events.BeforeShow, new Listener<MenuEvent>(){
                public void handleEvent(MenuEvent be) {
                    DataListItem selectedItem = references.getSelectedItem();
                    if (selectedItem != null) {
                        selectedItem.hideToolTip();
                    }
                }});

  4. #4
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    131
      0  

    Default

    I would not count this as a bug. You can define the hidingtime of the tooltip to hide asap. You could also define a higher zIndex for the menu, so that the menu is on top.

  5. #5
    Ext User
    Join Date
    Jun 2008
    Posts
    365
    Vote Rating
    0
      0  

    Default

    Well, if the menu is on top, then you will partially see the tooltip.

    I don't expect to see both tooltip and context menu. I would expect the tooltip to be hidden when I open the context menu or even when I just click anywhere, like in many other apps (try a right - or left - click on an icon in your personal bar in Firefox or try on icons in your Windows XP desktop or explorer)

  6. #6
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    131
      0  

    Default

    You can configure your tooltip to hide asap when the mouse leaves

  7. #7
    Ext User
    Join Date
    Jun 2008
    Posts
    365
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by sven View Post
    You can configure your tooltip to hide asap when the mouse leaves
    Yep, I know that but when you (left or right) click on the component, it doesn't hide the tooltip, while many other apps do.

  8. #8
    Ext User
    Join Date
    Jun 2008
    Posts
    365
    Vote Rating
    0
      0  

    Default

    So, this is a "WONTFIX" issue ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •