From 6d05fb8680fb3611cfa4a1eb63a42526761715ec Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 2 Feb 2021 16:46:07 -0800 Subject: [PATCH] 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. --- src/app/components/SpeciesColorPicker.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/components/SpeciesColorPicker.js b/src/app/components/SpeciesColorPicker.js index 9bf801a..2172167 100644 --- a/src/app/components/SpeciesColorPicker.js +++ b/src/app/components/SpeciesColorPicker.js @@ -216,8 +216,11 @@ function SpeciesColorPicker({ aria-label="Pet species" value={speciesId} // We also wait for the valid pairs before enabling, so users can't - // trigger change events we're not ready for. - isLoading={allSpecies.length === 0 || loadingValids} + // trigger change events we're not ready for. Also, if the caller + // hasn't provided species and color yet, assume it's still loading. + isLoading={ + allColors.length === 0 || loadingValids || !speciesId || !colorId + } isDisabled={isDisabled || speciesIsDisabled} // Don't fade out in the speciesIsDisabled case; it's more like a // read-only state.