Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip: overflows window boundaries #7071

Closed
iessa-pragg-ctct opened this issue Jan 10, 2025 · 0 comments
Closed

Tooltip: overflows window boundaries #7071

iessa-pragg-ctct opened this issue Jan 10, 2025 · 0 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@iessa-pragg-ctct
Copy link
Contributor

iessa-pragg-ctct commented Jan 10, 2025

Describe the bug

The tooltip component 'edge detection' is not working in some positions, specifically when using the positions top and bottom and being near the edges of the screen.

Pull Request Link

#7072

Investigation

Partially investigated, seems to be related to some kind of external code that is doing edge detection. Have not had time to investigate further. Could not easily find the code in question.


The functions getOuterWidth and getOuterHeight are coming from some dom utils package that is not obvious to find.

Seems like the alignment for top & bottom are not taking X into account for bounds checking.

if (modifiers.top) {
this.alignTop(el);
if (this.isOutOfBounds(el)) {
this.alignBottom(el);
if (this.isOutOfBounds(el)) {
this.alignTop(el);
}
}
} else if (modifiers.left) {

Reproducer

https://stackblitz.com/edit/vitejs-vite-gqcccukb

Environment

Windows 11

Vue version

3.5.13

PrimeVue version

4.2.5

Node version

18.20.3

Browser(s)

Chrome 131

Steps to reproduce the behavior

  1. Add a tooltip to an element that is near the left/right side of the screen
  2. Set the position of the tooltip to either top or bottom

Expected behavior

The tooltip remains fully on the screen regardless of the position of the target element.

@iessa-pragg-ctct iessa-pragg-ctct added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 10, 2025
@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jan 13, 2025
@tugcekucukoglu tugcekucukoglu added this to the 4.3.0 milestone Jan 13, 2025
@github-project-automation github-project-automation bot moved this to Review in PrimeVue Jan 13, 2025
@tugcekucukoglu tugcekucukoglu self-assigned this Jan 13, 2025
tugcekucukoglu added a commit that referenced this issue Jan 13, 2025
#7071 enhance edge detection for tooltips
@github-project-automation github-project-automation bot moved this from Review to Done in PrimeVue Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
Status: Done
Development

No branches or pull requests

2 participants