question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[data-table] Cannot read property 'checked of undefined'

See original GitHub issue

Bug 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

  1. 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:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
abhiomkarcommented, Aug 16, 2019

Thanks for reporting issue. We need a working example to investigate this.

0reactions
buzziamcommented, Aug 23, 2019

I believe this issue was occurring because the underlying model was being modified at the same time .layout() was being called. Closing for now.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found