Skip to content

Commit f6b6488

Browse files
authored
Allow null and undefined values for [matTooltip] explicitly.
We have tests that already set these values (but used to use nullness assertions to overcome the build failures) and protect against it by treating these values as empty strings (and thus we hide the tooltip), but we don't allow anyone who uses templates with strict type checking to set optional values unless they add their own nullness assertion.
1 parent 5898911 commit f6b6488

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/material/tooltip/tooltip.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ export class MatTooltip implements OnDestroy, AfterViewInit {
300300
return this._message;
301301
}
302302

303-
set message(value: string) {
303+
set message(value: string | null | undefined) {
304304
this._ariaDescriber.removeDescription(this._elementRef.nativeElement, this._message, 'tooltip');
305305

306306
// If the message is not a string (e.g. number), convert it to a string and trim it.

0 commit comments

Comments
 (0)