fix(material/list): allow mat-list-item outside list#26092
fix(material/list): allow mat-list-item outside list#26092crisbeto merged 1 commit intoangular:mainfrom
Conversation
In the MDC-based list having a `MatListItem` outside of a list throws a DI error, whereas in the legacy version it didn't. These changes make injecting the list optional and try to gracefully handle the absence of a list. I've also removed the `mat-mdc-list-non-interactive` class since the same can be achieved without it. Fixes angular#26013.
8985d12 to
0011526
Compare
| this._noopAnimations = animationMode === 'NoopAnimations'; | ||
|
|
||
| if (!this._listBase._isNonInteractive) { | ||
| if (_listBase && !_listBase._isNonInteractive) { |
There was a problem hiding this comment.
yeah, we chatted about this, but I'm still not sure if this is the best way. If the e.g. list item in a template suddenly ends up being used in e.g. an interactive list, the item will not get that treatment right?
There was a problem hiding this comment.
It won't, but I think that it'll work more or less like it does in the non-MDC version so that's why I went ahead with the change.
There was a problem hiding this comment.
Ah if that's the case, then I favor this solution for the simplicity
In the MDC-based list having a `MatListItem` outside of a list throws a DI error, whereas in the legacy version it didn't. These changes make injecting the list optional and try to gracefully handle the absence of a list. I've also removed the `mat-mdc-list-non-interactive` class since the same can be achieved without it. Fixes #26013. (cherry picked from commit 936741c)
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
In the MDC-based list having a
MatListItemoutside of a list throws a DI error, whereas in the legacy version it didn't. These changes make injecting the list optional and try to gracefully handle the absence of a list.I've also removed the
mat-mdc-list-non-interactiveclass since the same can be achieved without it.Fixes #26013.