Skip to content

TypeError Cannot read property of undefined - selection.js line 24 #1098

@jonrandahl

Description

@jonrandahl

@AllenFang

First, thanks for the amazing tool, it truly has made our project so much easier having it in our toolbox! Hopefully, we can pay your hard work forward by helping to resolve this bug which possibly relates to three other tickets: #939, #599, and #515

Version Info

  • "react": "^16.8.6",
  • "react-dom": "^16.8.6",
  • "react-bootstrap-table-next": "^3.2.0",
  • "react-bootstrap-table2-editor": "^1.4.0",
  • "react-bootstrap-table2-filter": "^1.2.0",
  • "react-bootstrap-table2-overlay": "^2.0.0",
  • "react-bootstrap-table2-paginator": "^2.1.0",
  • "react-bootstrap-table2-toolkit": "^2.1.0",

Describe the bug
We're using custom filters via checkboxes to remove rows with one of our specific "label" properties.

While this works perfectly most of the time, we've noticed an increasing amount of occurrences on the live instance of our app where clicking a filter checkbox will throw the following error:

TypeError: Cannot read property 'campaignID' of undefined
   at selection.js:25
   at Array.map (<anonymous>)
   at t.getSelectionSummary (selection.js:24)
   at t.value (selection-context.js:208)
   at ga (react-dom.production.min.js:3880)
   at ma (react-dom.production.min.js:3871)
   at Ys (react-dom.production.min.js:6116)
   at zs (react-dom.production.min.js:5101)
   at Bs (react-dom.production.min.js:4958)
   at Ds (react-dom.production.min.js:4817)
   at react-dom.production.min.js:2543
   at t.unstable_runWithPriority (scheduler.production.min.js:338)
   at lo (react-dom.production.min.js:2513)
   at yo (react-dom.production.min.js:2538)
   at ho (react-dom.production.min.js:2528)
   at Rs (react-dom.production.min.js:4865)
   at react-dom.production.min.js:1783
   at HTMLDocument.r (helpers.js:87)
(anonymous) @ breadcrumbs.js:76

Where the campaignID is the key on the row.

To Reproduce
Steps to reproduce the behaviour:

  1. Go to one fo the "pages" where the filters exist
  2. Click on a checkbox to filter the tabular data based on the remaining labels
  3. Click on a different checkbox to filter the tabular data again
  4. Repeat N times
  5. See error above

Screenshots
If applicable, add screenshots to help explain your problem.
image

codesandbox
While we would love to create an example on https://codesandbox.io as the site contains live client data this is not able to happen - however, we do have videos of this occurring on our site which we would be happy to share privately at your request.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions