only show empty state on search

This commit is contained in:
Jeff Colombo 2019-02-10 00:06:10 -05:00
parent e23a42fea7
commit f053d72efa

View File

@ -121,7 +121,7 @@ export class PokemonSelectList extends React.Component<IPokemonSelectListProps,
}
</Measure>
}
{ listLength === 0 &&
{ listLength === 0 && this.props.filterTerm !== '' &&
<div className={ styles.emptyState }>
<i className="pokemon-missing-no" />
<h3>{ DEFAULT_POKEMON_NAME }</h3>
@ -160,7 +160,7 @@ export class PokemonSelectList extends React.Component<IPokemonSelectListProps,
const onClick = () => this.props.handleActivatePokemon(pokemon.id, pokemon.form);
return (
<a
key={ index + pokemon.id }
key={ `${index}-${pokemon.id}-${pokemon.form}` }
style={ style }
className={ anchorCss }
onClick={ onClick }