Skip to content
This repository was archived by the owner on Jun 28, 2026. It is now read-only.
This repository was archived by the owner on Jun 28, 2026. It is now read-only.

Tooltip position with custom element as appendTo #19627

Description

@markuczy

Describe the bug

When using appendTo option of tooltip with htmlElement, the position of it is completely omitted (see https://github.com/primefaces/primeng/blob/master/packages/primeng/src/tooltip/tooltip.ts#L617), which results in tooltip in incorrect place.

Currently the only option is to set positionLeft (see https://github.com/primefaces/primeng/blob/master/packages/primeng/src/tooltip/tooltip.ts#L701) or positionTop (see https://github.com/primefaces/primeng/blob/master/packages/primeng/src/tooltip/tooltip.ts#L702), but it would require constant update of the value when element's position changes. It would be better to have an option to at least specify a callback which is executed on getHostOffset (like primeng is doing for body https://github.com/primefaces/primeng/blob/master/packages/primeng/src/tooltip/tooltip.ts#L618).

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/github-looscpmc?file=src%2Fapp%2Fapp.component.html

Environment

stackblitz

Angular version

21

PrimeNG version

v21

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

Open stackblitz page with tooltip usage

Expected behavior

Its possible to offset tooltip correctly with custom appendTo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: EnhancementIssue contains an enhancement related to a specific component. Additional functionality has been add

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions