elm-street-technology / elevate-ui

🎨 💻 📱An opinionated toolkit of React components and patterns
https://elevate-ui.com/
MIT License
10 stars 4 forks source link

CheckboxTable Checked States When No Values Are Checked #104

Open jwdotjs opened 6 years ago

jwdotjs commented 6 years ago

As a developer, when I add a checkbox table that allows me to select records in the table, and one of my actions is to "Delete Records", when the delete is completed, the UI reflects the remaining records but the CheckboxTable remains in a "Checked" state where the actionbar persists.

I haven't looked at the underlying code, but if CheckboxTable is using Formik, we may need to use enableReinitialize={true}

screen shot 2018-09-30 at 1 56 21 pm

Note in the above screenshot that actionbar persists but no records are checked

chrisheninger commented 6 years ago

Wouldn't be formik– not sure if it's on our end or here: https://github.com/react-tools/react-table/tree/master/src/hoc

erwstout commented 5 years ago

The issue is that the selection never gets cleared when the action is completed. We need to figure out a way to set the selection array in state to empty. I think adding toggleAll(true) to the callback to action buttons would work.