Results 1 to 5 of 5

Thread: [FIXED][1.1] Tooltips don't hide when a Button is clicked

  1. #1
    Ext GWT Premium Member
    Join Date
    Jul 2008
    Posts
    33

    Default [FIXED][1.1] Tooltips don't hide when a Button is clicked

    Steps to Reproduce:
    1. Run the following example.

    Code:
    import com.extjs.gxt.ui.client.widget.button.Button;
    import com.extjs.gxt.ui.client.widget.button.SplitButton;
    import com.extjs.gxt.ui.client.widget.toolbar.SplitToolItem;
    import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
    import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.ui.RootPanel;
    import com.google.gwt.user.client.ui.VerticalPanel;
    
    public class sandbox implements EntryPoint {
    
        /**
         * This is the entry point method.
         */
        public void onModuleLoad() {
            RootPanel.get().add(buildToolTipExample());
        }
        
        private VerticalPanel buildToolTipExample(){
            VerticalPanel panel = new VerticalPanel();
            
            //Button
            Button button = new Button("click me");
            button.setToolTip("Button tooltip");
            panel.add(button);
            
            //SplitButton
            SplitButton splitButton = new SplitButton("split");
            splitButton.setToolTip("SplitButton tooltip");
            panel.add(splitButton);
            
            ToolBar toolbar = new ToolBar();
            //TextToolItem
            TextToolItem textToolItem = new TextToolItem("TextToolItem");
            textToolItem.setToolTip("TextToolItem tooltip");
            toolbar.add(textToolItem);
            
            //SplitToolItem
            SplitToolItem splitToolItem = new SplitToolItem("SplitToolItem");
            splitToolItem.setToolTip("SplitToolItem tooltip");
            toolbar.add(splitToolItem);
            
            panel.add(toolbar);
            return panel;
        }
    }
    2. Hover over any button until the associated tooltip appears.
    3. Click on the button without moving the mouse. The tooltip remains.

    Expected:
    ToolTips on Buttons and TextToolItems (and any children of these classes) should automatically hide when the button is clicked or when an attached menu is shown.

    Workaround:
    Attach a Select listener (or a BeforeShow listener on the menu if you prefer) and call:
    Code:
    getToolTip().hide();
    Just calling hideToolTip() doesn't seem to make the tooltip disappear instantly. My hunch is that this has to do with the hideDelay, etc. But just to be clear, the desired behavior is for the the tooltip to disappear instantly when any part of a button is clicked.

    I included the SplitButton and SplitToolItem in the example because they add the additional complexity of the arrow button that is independently clickable. So in this case, the hide logic must apply to both the left side of the button and the arrow button.

  2. #2
    Sencha User darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242

    Default

    Fixed in SVN.

  3. #3
    Ext GWT Premium Member
    Join Date
    Jul 2008
    Posts
    33

    Default

    You Rule.

  4. #4
    Ext GWT Premium Member
    Join Date
    Jul 2008
    Posts
    33

    Default

    The bug still exists for ToggleButton and ToggleToolItem. I have attached new sample code that includes these:

    Code:
    import com.extjs.gxt.ui.client.widget.button.Button;
    import com.extjs.gxt.ui.client.widget.button.SplitButton;
    import com.extjs.gxt.ui.client.widget.toolbar.SplitToolItem;
    import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
    import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.ui.RootPanel;
    import com.google.gwt.user.client.ui.VerticalPanel;
    
    public class sandbox implements EntryPoint {
    
        /**
         * This is the entry point method.
         */
        public void onModuleLoad() {
            RootPanel.get().add(buildToolTipExample());
        }
        
        private VerticalPanel buildToolTipExample(){
    		VerticalPanel panel = new VerticalPanel();
    		
    		//Button
    		Button button = new Button("click me");
    		button.setToolTip("Button tooltip");
    		panel.add(button);
    		
    		//ToggleButton
    		ToggleButton toggleButton = new ToggleButton("toggleButton");
    		toggleButton.setToolTip("ToggleButton tooltip");
    		panel.add(toggleButton);
    		
    		//SplitButton
    		SplitButton splitButton = new SplitButton("split");
    		splitButton.setToolTip("SplitButton tooltip");
    		panel.add(splitButton);
    		
    		ToolBar toolbar = new ToolBar();
    		//TextToolItem
    		TextToolItem textToolItem = new TextToolItem("TextToolItem");
    		textToolItem.setToolTip("TextToolItem tooltip");
    		toolbar.add(textToolItem);
    		
    		//ToggleToolItem
    		ToggleToolItem toggleToolItem = new ToggleToolItem("ToggleToolItem");
    		toggleToolItem.setToolTip("ToggleToolItem tooltip");
    		toolbar.add(toggleToolItem);
    		
    		//SplitToolItem
    		SplitToolItem splitToolItem = new SplitToolItem("SplitToolItem");
    		splitToolItem.setToolTip("SplitToolItem tooltip");
    		toolbar.add(splitToolItem);
    		
    		panel.add(toolbar);
    		return panel;
    	}
    }

  5. #5
    Sencha User darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242

    Default

    Fix is in SVN.

Posting Permissions

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