Fix bug in SpeciesColorPicker loading state

Oops, I made a fix to the color picker, but not the species picker! Updated them both to match.
This commit is contained in:
Emi Matchu 2021-02-02 16:46:07 -08:00
parent f699d867e5
commit 6d05fb8680

View file

@ -216,8 +216,11 @@ function SpeciesColorPicker({
aria-label="Pet species" aria-label="Pet species"
value={speciesId} value={speciesId}
// We also wait for the valid pairs before enabling, so users can't // We also wait for the valid pairs before enabling, so users can't
// trigger change events we're not ready for. // trigger change events we're not ready for. Also, if the caller
isLoading={allSpecies.length === 0 || loadingValids} // hasn't provided species and color yet, assume it's still loading.
isLoading={
allColors.length === 0 || loadingValids || !speciesId || !colorId
}
isDisabled={isDisabled || speciesIsDisabled} isDisabled={isDisabled || speciesIsDisabled}
// Don't fade out in the speciesIsDisabled case; it's more like a // Don't fade out in the speciesIsDisabled case; it's more like a
// read-only state. // read-only state.