Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(data-warehouse): submit form on enter #23925

Merged
merged 10 commits into from
Jul 23, 2024
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion frontend/src/lib/lemon-ui/LemonDialog/LemonDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,15 @@ export const LemonFormDialog = ({
}, [])

return (
<Form logic={lemonDialogLogic} formKey="form">
<Form
logic={lemonDialogLogic}
formKey="form"
onKeyDown={(e: React.KeyboardEvent<HTMLFormElement>): void => {
if (e.key === 'Enter' && primaryButton?.htmlType === 'submit' && isFormValid) {
void onSubmit(form)
}
}}
>
<LemonDialog {...props} primaryButton={primaryButton} secondaryButton={secondaryButton} />
</Form>
)
Expand Down
Loading