1
0
Fork 0

fix bug with remove button in search

This commit is contained in:
Matt Dunn-Rankin 2020-04-25 20:21:51 -07:00
parent 8866b6bca6
commit ce8142cdbe
3 changed files with 1 additions and 5 deletions

View file

@ -45,8 +45,8 @@ export function Item({ item, itemNameId, outfitState, dispatchToOutfit }) {
variant="ghost" variant="ghost"
color="gray.400" color="gray.400"
onClick={(e) => { onClick={(e) => {
e.stopPropagation();
dispatchToOutfit({ type: "removeItem", itemId: item.id }); dispatchToOutfit({ type: "removeItem", itemId: item.id });
e.preventDefault();
}} }}
opacity="0" opacity="0"
transitionProperty="opacity color" transitionProperty="opacity color"

View file

@ -196,7 +196,6 @@ function SearchResults({
} }
}; };
console.log(firstSearchResultRef);
return ( return (
<ScrollTracker threshold={300} onScrolledToBottom={onScrolledToBottom}> <ScrollTracker threshold={300} onScrolledToBottom={onScrolledToBottom}>
<ItemListContainer> <ItemListContainer>
@ -211,7 +210,6 @@ function SearchResults({
ref={index === 0 ? firstSearchResultRef : null} ref={index === 0 ? firstSearchResultRef : null}
onChange={onChange} onChange={onChange}
onKeyDown={(e) => { onKeyDown={(e) => {
console.log(e.key);
if (e.key === "ArrowUp") { if (e.key === "ArrowUp") {
goToPrevItem(e); goToPrevItem(e);
} else if (e.key === "ArrowDown") { } else if (e.key === "ArrowDown") {

View file

@ -74,7 +74,6 @@ function SpeciesColorPicker({
if (allValidSpeciesColorPairs.has(pair)) { if (allValidSpeciesColorPairs.has(pair)) {
dispatchToOutfit({ type: "changeColor", colorId: e.target.value }); dispatchToOutfit({ type: "changeColor", colorId: e.target.value });
} else { } else {
console.log(pair, Array.from(allValidSpeciesColorPairs));
const species = allSpecies.find((s) => s.id === speciesId); const species = allSpecies.find((s) => s.id === speciesId);
const color = allColors.find((c) => c.id === colorId); const color = allColors.find((c) => c.id === colorId);
toast({ toast({
@ -91,7 +90,6 @@ function SpeciesColorPicker({
if (allValidSpeciesColorPairs.has(pair)) { if (allValidSpeciesColorPairs.has(pair)) {
dispatchToOutfit({ type: "changeSpecies", speciesId: e.target.value }); dispatchToOutfit({ type: "changeSpecies", speciesId: e.target.value });
} else { } else {
console.log(pair, Array.from(allValidSpeciesColorPairs));
const species = allSpecies.find((s) => s.id === speciesId); const species = allSpecies.find((s) => s.id === speciesId);
const color = allColors.find((c) => c.id === colorId); const color = allColors.find((c) => c.id === colorId);
toast({ toast({