Skip to content

fix(material/tooltip): only expand hover area on side closest to trigger #26786

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

Merged
merged 1 commit into from
Mar 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions src/material/tooltip/tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,32 @@
&::before {
$offset: -8px;
content: '';
top: $offset;
right: $offset;
bottom: $offset;
left: $offset;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -1;
position: absolute;

// Only set the offset on the side closest to the panel so we
// don't accidentally cover more content than we need to.
.mat-mdc-tooltip-panel-below & {
top: $offset;
}

.mat-mdc-tooltip-panel-above & {
bottom: $offset;
}

// Note that here we use left/right instead of before/after
// so that we don't have to add extra styles for RTL.
.mat-mdc-tooltip-panel-right & {
left: $offset;
}

.mat-mdc-tooltip-panel-left & {
right: $offset;
}
}

&._mat-animation-noopable {
Expand Down