-
Notifications
You must be signed in to change notification settings - Fork 159
fix(tooltip/snackbar): use overlay service size registry to set initial size - master #16837
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
base: master
Are you sure you want to change the base?
Conversation
wnvko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we know this PR is breaking the tooltip. What is the reason this happening? Can we revert the change that made this happen?
Adding this additional property to the overlay settings and use it in this way in the tooltip looks like a breaking change. IMO it will be better to find out what happened in the above mentioned PR and to revert it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
projects/igniteui-angular/snackbar/src/snackbar/snackbar.component.spec.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
projects/igniteui-angular/test-utils/tooltip-components.spec.ts
Outdated
Show resolved
Hide resolved
|
@wnvko The linked PR does not break the tooltip. This PR was merged in version 20.1.0, but the behavior is observed in version 15.0.x too (maybe even before that, but I tested with that version). The PR adds a lot of changes, but the one that is related to the current behavior is adding this CSS: min-width: rem(24px);
max-width: rem(200px);
width: fit-content;The new styles did not break the tooltip, but revealed the already broken behavior. Overall, it is due to the element's size (width) being measured before being moved to the overlay content. If the element does not have a specific width set, like 100px, its size is affected by the styles that come from the parent container. For example, consider this template: <div style="background: red; text-transform: uppercase; letter-spacing: 8px;" [igxTooltipTarget]="themeTooltipRef4">
Parent Element
<div #themeTooltipRef4="tooltip" igxTooltip>Click to toggle between dark/light themes</div>
</div>The parent element (red div) has these styles However, the result is the following: That's because the tooltip/element is measured and then moved to the overlay. While being measured, the tooltip is affected by the styles of the parent, and a bigger size is set as the The snackbar behavior is due to this PR. Not exactly breaking it, since before this PR, the snackbar had no size (perhaps because it was not present in the view yet) I removed the additional property from the overlay settings and implemented a different approach, but similar to the previous one, it requires moving the element to the overlay and then getting its size. |






Closes #16458
Additional information (check all that apply):
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)