hubmapconsortium / antibody-api

API for the Antibody DB.
https://avr.hubmapconsortium.org/
0 stars 0 forks source link

Lifting state for clearset all in model #141

Closed ChuckKollar closed 1 year ago

ChuckKollar commented 1 year ago

This work was done to add the Set and Clear (all) button to the Checkboxes in the Modal (AdditionalColumns). There were several problems. The first involved pushing the state up into a parent component (the new AdditionalColumns). So, a Checkbox had to communicate with it to get and set state, the state being kept in an array for each Checkbox. The other problem was with the Set Clear buttons, while they could set the state it was not available till the next refresh cycle, so the DOM display elements needed to be set by those buttons. The same DOM code is also used by the handleChange method that is called when the user clicks on a Checkbox. There were also some warnings given by React which requires a key when making an array of objects that got fixed along the way.