Skip to content

Make Badge implement HasTooltip #10

Description

@ngonzalezpazFC

It would be useful if each Badge could display a tooltip when hovering over it.

badge

As a workaround I made it work with this code:

                    Span span = new Span(i);
                    Tooltip.forComponent(span).withText(getTranslation(
                            "snaplets.usermanager.viewsview.hardcodedroles.tooltip"))
                            .withPosition(Tooltip.TooltipPosition.TOP_START);

                    Badge b = new Badge(span);
                    b.addThemeName(BadgeVariant.CONTRAST.getVariantName());
                    b.getStyle().setCursor("pointer");

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions