add enter key to search for a player
All checks were successful
Deploy App / docker (ubuntu-latest) (push) Successful in 56s

This commit is contained in:
Lee 2024-04-14 21:18:19 +01:00
parent 01d0ad468a
commit 094a6c697e

View File

@ -27,10 +27,21 @@ export default function PlayerSearch() {
});
};
const handleKeyDown = (e: any) => {
if (e.key === "Enter") {
handleSearch();
}
};
return (
<div className="flex flex-col items-center gap-8">
<div className="flex items-center gap-2">
<Input className="w-[200px]" placeholder="Player ID" onChange={(e) => setPlayerId(e.target.value)} />
<Input
className="w-[200px]"
placeholder="Player ID"
onChange={(e) => setPlayerId(e.target.value)}
onKeyDown={handleKeyDown}
/>
<Button onClick={() => handleSearch()}>Search</Button>
</div>