Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button tool tip appears on popup content #17

Open
mwolf9 opened this issue Jul 2, 2013 · 0 comments
Open

Button tool tip appears on popup content #17

mwolf9 opened this issue Jul 2, 2013 · 0 comments

Comments

@mwolf9
Copy link

mwolf9 commented Jul 2, 2013

When using the Vaadin 7 version of PopupButton the tool tip set on the button is propagated to the popup content causing mouse overs on the content to show the tool tip.

In order to fix this I modified the PopupButtonConnector class to override the getToolTipInfo(Element element) Method like so:

@Override
public TooltipInfo getTooltipInfo(Element element) {
    if (getWidget().isElementPartOfPopupButton(element)) {
        return super.getTooltipInfo(element);
    }

    return null;
}

I also modified the VPopupButton Class by changing the constructor and adding a new field and method:

public DivElement indicatorElement;

public VPopupButton() {
    super();
    indicatorElement = Document.get().createDivElement();
    indicatorElement.setClassName(POPUP_INDICATOR_CLASSNAME);
    getElement().getFirstChildElement().appendChild(indicatorElement);
}

public boolean isElementPartOfPopupButton(Element element) {
    return element.equals(getElement()) || element.equals(wrapper)
            || element.equals(captionElement)
            || element.equals(indicatorElement);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant