Skip to content

S2 tooltip doesn't position itself correctly when place near the bottom of the screen #8027

Open
@LFDanLu

Description

@LFDanLu

This seems to be due to a combination of the margin applied to the tooltip making calculatePosition think the tooltip is much larger than it is and thus causing some issues when calculating the overlay position. Will need to dig into

position = computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);

Additionally, I'm not sure if the margin of the overlay should actually be considered as part of the tooltip.

Other problematic area:
arrowMinPosition doesn't take into account the margin, depends on the answer to the question above
arrowMaxPosition should either not subtract overlayMargin (if we don't want to consider the margin as part of the tooltip's actual size) OR should be adding the portion of the overlay margin that matters (aka marginBottom if we are placing the tooltip to the right of the button). At the moment, it subtracts overlayMargin which is just completely wrong since that is both top+bottom/right+left margin when we only need either bottom/left since position: 0 of the arrow already compensates for margin top/left

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    Projects

    Status

    ✏️ To Groom

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions