Skip to content

Avatar tooltip not displayed on hover #5105

Closed
vaadin/web-components
#5932

Description

@javier-godoy

Description

After the page is loaded, hovering the Avatar does not display tooltip. (The tooltip is only visible if the mouse cursor is above the Avatar when the component is first rendered, but after that the tooltip is not displayed again.)
avatar

Expected outcome

I would expect that the tooltip is displayed, because the Avatar is configured with setTooltipEnabled(true).

Minimal reproducible example

Avatar avatar = new Avatar();
avatar.setAbbreviation("A");
avatar.setName("name");
avatar.setTooltipEnabled(true);
add(avatar);

Steps to reproduce

  1. Add the snippet above to a view
  2. Hover on the tooltip
  3. Notice how the tooltip is not displayed

Environment

Vaadin version(s): 23.3.12

Browsers

No response

Activity

  1. self-assigned this
    on May 31, 2023
  2. sissbruecker commented on May 31, 2023

    @sissbruecker
    Member

    Started looking into this. The tooltip overlay only shows if the target element (avatar in this case) is considered fully visible. For avatar that can be problematic, as avatar uses a negative margin to compensate for a possible outline. So if the avatar is positioned at the edge of its scroll container it is not considered fully visible and the tooltip doesn't show.

    Workarounds should be to either add a margin to the container, or remove the negative margin from the avatar.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions