You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Front-end: Examine Select-all Behavior in FacilitiesMultiSelect.js
Expected behavior
Behavior could be as expected, but worth examining for possible performance improvements.
Actual behavior
src/components/FacilitiesMultiSelect.js
Inside the useEffect, you are checking the length of facilities against the length of
selected facilities to determine if "Select All" should be on or off. In this case, the
selectedFacilities dependency could potentially cause frequent re-renders.
The code block: selectedFacilities.indexOf(id) > -1 inside the map function
can be performance-intensive if there are many facilities since indexOf would be O(n).
The "Select All" option toggles the state, which means if all facilities are already selected
and a user clicks "Select All" again, it will deselect all. If this is the desired behavior, it's
okay. If not, you might want to address it.
The text was updated successfully, but these errors were encountered:
Issue Report
Front-end: Examine Select-all Behavior in FacilitiesMultiSelect.js
Expected behavior
Behavior could be as expected, but worth examining for possible performance improvements.
Actual behavior
src/components/FacilitiesMultiSelect.js
Inside the useEffect, you are checking the length of facilities against the length of
selected facilities to determine if "Select All" should be on or off. In this case, the
selectedFacilities dependency could potentially cause frequent re-renders.
The code block: selectedFacilities.indexOf(id) > -1 inside the map function
can be performance-intensive if there are many facilities since indexOf would be O(n).
The "Select All" option toggles the state, which means if all facilities are already selected
and a user clicks "Select All" again, it will deselect all. If this is the desired behavior, it's
okay. If not, you might want to address it.
The text was updated successfully, but these errors were encountered: