Fixed page reload issue on EnterKey press

This commit is contained in:
monilprajapati
2024-06-17 12:24:32 +05:30
parent e4dd9a53f2
commit 1296af8786
6 changed files with 32 additions and 2 deletions
+5
View File
@@ -75,6 +75,11 @@ const DiscordChat = props => {
fullWidth
value={currentRefinement}
onChange={(event) => refine(event.currentTarget.value)}
onKeyDown={(event) => {
if(event.key === "Enter") {
event.preventDefault();
}
}}
placeholder="Search Discord Chats"
style={{ backgroundColor: theme.palette.inputColor, borderRadius: borderRadius, margin: 10, width: "100%", }}
InputProps={{