-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(material-experimental/mdc-table): error when flexbox-based table is initialized #21428
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
Conversation
…is initialized The MDC-based table tries to add a class to its internal `tbody` element and it assumes that it's always going to find it. The assumption used to be correct since we only supported native `table` elements for the MDC implementation, however as of angular#20994 we also support flexbox-based ones which throw an error, because they don't have a `tbody`. These changes add a check to prevent the error and include a couple of sanity tests to catch issues like this in the future. I've also reworked the tests so that they use the MDC-based `MatPaginator` and `MatTableDataSource`, instead of the base ones.
"@npm//@angular/platform-browser", | ||
"@npm//rxjs", | ||
], | ||
) | ||
|
||
ng_web_test_suite( | ||
name = "unit_tests", | ||
static_files = ["@npm//:node_modules/@material/data-table/dist/mdc.dataTable.js"], | ||
static_files = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do the new tests need these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the tests now use the MDC-based paginator which has an internal form field and button. These are the MDC js files that they depend on.
…is initialized (#21428) The MDC-based table tries to add a class to its internal `tbody` element and it assumes that it's always going to find it. The assumption used to be correct since we only supported native `table` elements for the MDC implementation, however as of #20994 we also support flexbox-based ones which throw an error, because they don't have a `tbody`. These changes add a check to prevent the error and include a couple of sanity tests to catch issues like this in the future. I've also reworked the tests so that they use the MDC-based `MatPaginator` and `MatTableDataSource`, instead of the base ones. (cherry picked from commit 2255b66)
…d table is initialized (angular#21428)" This reverts commit aade5d1.
…ox-based table is initialized (angular#21428)"
…is initialized (angular#21428) The MDC-based table tries to add a class to its internal `tbody` element and it assumes that it's always going to find it. The assumption used to be correct since we only supported native `table` elements for the MDC implementation, however as of angular#20994 we also support flexbox-based ones which throw an error, because they don't have a `tbody`. These changes add a check to prevent the error and include a couple of sanity tests to catch issues like this in the future. I've also reworked the tests so that they use the MDC-based `MatPaginator` and `MatTableDataSource`, instead of the base ones.
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. |
The MDC-based table tries to add a class to its internal
tbody
element and it assumes that it's always going to find it. The assumption used to be correct since we only supported nativetable
elements for the MDC implementation, however as of #20994 we also support flexbox-based ones which throw an error, because they don't have atbody
.These changes add a check to prevent the error and include a couple of sanity tests to catch issues like this in the future.
I've also reworked the tests so that they use the MDC-based
MatPaginator
andMatTableDataSource
, instead of the base ones.