Commit 9401323
Allow undefined & null values in [matTooltip] explicitly (#29397)
* fix(material/tooltip): Update MatTooltip's "message not present" test to use null/undefined types outright.
We were using nullness assertions to cause these assignments to succeed, but we should allow users to set null/undefined values outright.
Right now we don't, so this update will cause the tests to fail. But this will be soon fixed.
* fix(material/tooltip): 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.
* fix(material/tooltip): Also explicitly define the type of `MatTooltip.message` getter as always a string.
We do this since the underlying `._message` type is a string, the message setter can accept null and undefined values, but will convert them to strings before saving to `_message`, so we can always assume someone _reading_ the value will see a plain string.
* ci: Approve new API goldens for tooltip
---------
Co-authored-by: Miles Malerba <mmalerba@google.com>1 parent a454216 commit 9401323
File tree
3 files changed
+5
-5
lines changed- src/material/tooltip
- tools/public_api_guard/material
3 files changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
416 | | - | |
| 416 | + | |
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
421 | | - | |
| 421 | + | |
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
| 299 | + | |
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
| 303 | + | |
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
0 commit comments