Skip to content

[Tooltip]: unexpected placement change of body when it doesn't fit the available space #3016

@vasilii-kovalev

Description

@vasilii-kovalev

Description

Tooltips change their placement from top/bottom to right/left when they don't fit the available space.

Steps to Reproduce

  1. Place a control with a tooltip with some content (for example, 3-5 words) near the edge of the screen (for example, near the right edge of the screen). Do not set any placement
  2. Hover over the control (or focus on it using keyboard) for the tooltip to appear and observe its placement
  3. Move the control far away from the screen's side so that the content of the tooltip could be fully displayed in one line
  4. Repeat step 2

Actual result

When the content of the tooltip fits the available space, it is displayed above the target and centered on it.
When it doesn't, it is displayed to the left of it, as shown in the screenshot below.
Image

Expected result

When the content of the tooltip fits the available space, it is displayed above the target and centered on it.
When it doesn't, it is still displayed above the target, but the body is shifted to the left a little, as shown in the screenshot below.
Image

Environment

  • UUI version: 6.4.1
  • Browser name: Google Chrome v.143.0.7499.193
  • Operating System: Windows 11 x64

Additional information

  • The expected behavior can be achieved when manually setting placement="top-right", but in this case it will always be displayed like this, even when there is enough available space for the content to be displayed in one line. So it means the previous behavior (before migration to Float UI) is currently lost
  • Using shift middleware doesn't help

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions