[data-table] Cannot read property 'checked of undefined'
See original GitHub issueBug report
Upon rendering a page containing an @material/data-table, and then attempting to interact with checkboxes - the following error is reported in the JS Console:
Uncaught TypeError: Cannot read property 'checked' of undefined
at Object.isHeaderRowCheckboxChecked (component.ts:162)
at MDCDataTableFoundation.handleHeaderRowCheckboxChange (foundation.ts:193)
at HTMLTableRowElement.handleHeaderRowCheckboxChange_ (component.ts:71)
However, if the rendered view is changed to the previous view (where the data-table is not) and then changed again to the view in which the data-table exists, clicking on a checkbox results in no error.
Got to run - but I’ll see if I can distill the problem into a repeatable demo in a starter kit within the next 24hrs.
Steps to reproduce
- Will try to get a demo together in the next 24.
Actual behavior
Clicking on a check box in a table row results in the above error.
Expected behavior
Clicking on check box in a table row results in no error.
Screenshots
N/A
Your Environment:
Software | Version(s) |
---|---|
MDC Web | 3.1.0 |
Browser | Chrome 76.0.3809.100 |
Operating System | Win 10 |
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Why am I getting the error "caught TypeError: Cannot read ...
When I try use both features on a single page, I get the error: "caught TypeError: Cannot read property 'style' of undefined".
Read more >Cannot read property 'checked' of undefined react checbox
i'm newbie in react. i want to toggle value with checkbox. but i have an error Cannot read property 'checked' of undefined ....
Read more >How to Fix the 'Cannot read property style of undefined' Error ...
In this article, we'll look at 'Cannot read property style of undefined' when we try to add a table with jQuery DataTables.
Read more >Uncaught TypeError: Cannot read property of null - iDiallo
All this means is that you are trying to access a property of an object that is undefined. These usually happens when we...
Read more >cannot read property of undefined (reading 'style') datatable
To fix the 'Cannot read property style of undefined' when we try to add a table with jQuery DataTables, we should make sure...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for reporting issue. We need a working example to investigate this.
I believe this issue was occurring because the underlying model was being modified at the same time
.layout()
was being called. Closing for now.