fix search bugs

This commit is contained in:
Aria Moradi 2021-03-24 03:28:02 +04:30
parent 85ec2ed367
commit a0115d88b0

View File

@ -50,6 +50,7 @@ export default function SearchSingle() {
} else { } else {
setError(false); setError(false);
setSearchTerm(value); setSearchTerm(value);
setMangas([]);
setMessage(''); setMessage('');
} }
} }
@ -86,12 +87,18 @@ export default function SearchSingle() {
return ( return (
<> <>
<form className={classes.root} noValidate autoComplete="off"> <div className={classes.root}>
<TextField inputRef={textInput} error={error} id="standard-basic" label="Search text.." /> <TextField
inputRef={textInput}
error={error}
id="standard-basic"
label="Search text.."
onKeyDown={(e) => e.key === 'Enter' && processInput()}
/>
<Button variant="contained" color="primary" onClick={() => processInput()}> <Button variant="contained" color="primary" onClick={() => processInput()}>
Search Search
</Button> </Button>
</form> </div>
{mangaGrid} {mangaGrid}
</> </>
); );