Skip to content

refactor(material/tooltip): use overlay outside click tracking #23123

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
Jul 20, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions src/material-experimental/mdc-tooltip/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ export class MatTooltip extends _MatTooltipBase<TooltipComponent> {
// Forces the element to have a layout in IE and Edge. This fixes issues where the element
// won't be rendered if the animations are disabled or there is no web animations polyfill.
'[style.zoom]': '_visibility === "visible" ? 1 : null',
'(body:click)': 'this._handleBodyInteraction()',
'(body:auxclick)': 'this._handleBodyInteraction()',
'aria-hidden': 'true',
}
})
Expand Down
6 changes: 4 additions & 2 deletions src/material/tooltip/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,10 @@ export abstract class _MatTooltipBase<T extends _TooltipComponentBase> implement
.pipe(takeUntil(this._destroyed))
.subscribe(() => this._detach());

this._overlayRef.outsidePointerEvents()
.pipe(takeUntil(this._destroyed))
.subscribe(() => this._tooltipInstance?._handleBodyInteraction());

return this._overlayRef;
}

Expand Down Expand Up @@ -892,8 +896,6 @@ export abstract class _TooltipComponentBase implements OnDestroy {
// Forces the element to have a layout in IE and Edge. This fixes issues where the element
// won't be rendered if the animations are disabled or there is no web animations polyfill.
'[style.zoom]': '_visibility === "visible" ? 1 : null',
'(body:click)': 'this._handleBodyInteraction()',
'(body:auxclick)': 'this._handleBodyInteraction()',
'aria-hidden': 'true',
}
})
Expand Down