Skip to content

Component | Tooltip | Fix: prevent container overflow when viewport size is reduced - #292

Merged
rokotyan merged 1 commit into
mainfrom
fix/tooltip-overflow
Oct 19, 2023
Merged

rokotyan merged 1 commit into
mainfrom
fix/tooltip-overflow

Conversation

@reb-dev

@reb-dev reb-dev commented Oct 18, 2023

Copy link
Copy Markdown
Contributor

closes: #286

@reb-dev

reb-dev commented Oct 18, 2023

Copy link
Copy Markdown
Contributor Author

@rokotyan There is a small issue still. Even though the overflow is gone, the tooltip's position still takes multiple triggers to update. See the video below:

Screen.Recording.2023-10-17.at.3.21.36.PM.mov

After investigating I discovered it is directly related to using scrollWidth. My original fix was to just use clientWidth instead, but then then breaks behavior for scrolling containers. For whatever reason though height isn't effected in the same way; from my testing clientHeight === scrollHeight but clientWidth <= scrollWidth even when they are under the same constraints.

Since it isn't a result of my changes here, I figured we can sill merge this and I can try to come up with a solution for the above issue in a separate PR.

@reb-dev
reb-dev requested a review from rokotyan October 19, 2023 00:34
@rokotyan

Copy link
Copy Markdown
Contributor

@reb-dev Thanks!

Yes, the previous code had the same issue. Let's merge this PR and fix the remaining issue in the next one.

@rokotyan rokotyan self-assigned this Oct 19, 2023
@rokotyan rokotyan added the fix Bug fix label Oct 19, 2023
@rokotyan rokotyan added this to the 1.2.3 milestone Oct 19, 2023
@rokotyan
rokotyan merged commit 6938b80 into main Oct 19, 2023
@Coronon

Coronon commented Oct 19, 2023

Copy link
Copy Markdown

Thank you very much everyone for this quick fix 🎉😇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hidden tooltip overflows viewport

3 participants