Skip to content

Tooltip min-width / max-width #162

Open
@longzheng

Description

@longzheng

In the latest version of angular-tooltips, the max-width behavior no longer seems to have an effect.

For very long tooltip content, the tooltip is always locked at the minimum min-width: 100px size.

Current behavior
image

I've used earlier versions of this library and it used to use absolute positioning to place the tooltip correctly on the page. However in the newer versions, you seem to have switched to a custom <tooltip> element with a position:relative CSS style.

Now the tip element is center positioned using the transform: translateX(50%) trick. Unfortunately the position:relative on the parent has the side effect of the tooltip content no longer having a variable width that will correctly adhere to the max-width layout. It will always try to be scaled as small as possible.

Ideal behavior
image

Are there any plans to revert the design of this library to its previous behavior so max-width works correctly?

  • Removing position: relative on the <tooltip> element
  • Using calculated top: XXpx left: XXpx values on the <tip> element from the nearest parent with position: relative

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions