Skip to content

Commit

Permalink
Fix debounce issue for text fields
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat committed Dec 19, 2024
1 parent 6fc0804 commit 37d72ab
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/frontend/src/components/forms/fields/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ export default function TextField({
onChange(event.currentTarget.value);
}
}}
onKeyDown={(event) => onKeyDown(event.code)}
onKeyDown={(event) => {
if (event.code === 'Enter') {
// Bypass debounce on enter key
onChange(event.currentTarget.value);
}
onKeyDown(event.code);
}}
rightSection={
value && !definition.required ? (
<IconX size='1rem' color='red' onClick={() => onTextChange('')} />
Expand Down

0 comments on commit 37d72ab

Please sign in to comment.