Skip to content

Commit 964fba2

Browse files
Support submitting PR preview modal with ENTER key (#2015)
## Motivation for the change, related issues My intuition expected to be able to submit the PR preview modal with an Enter key, but we did not yet support that. This PR adds that support. ## Testing Instructions (or ideally a Blueprint) - Run `npm run dev` and manually confirm that you can submit PR preview modals with both the Enter key from the input box and by clicking the "Submit" button.
1 parent 07513f9 commit 964fba2

File tree

1 file changed

+3
-3
lines changed
  • packages/playground/website/src/github/preview-pr

1 file changed

+3
-3
lines changed

packages/playground/website/src/github/preview-pr/form.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default function PreviewPRForm({
4242
}
4343
}, []);
4444

45-
async function handleSubmit(e: React.MouseEvent<HTMLButtonElement>) {
45+
async function handleSubmit(e: React.FormEvent) {
4646
e.preventDefault();
4747

4848
if (!value) {
@@ -209,7 +209,7 @@ export default function PreviewPRForm({
209209
}
210210

211211
return (
212-
<div>
212+
<form onSubmit={handleSubmit}>
213213
<div className={css.content}>
214214
{submitting && (
215215
<div className={css.overlay}>
@@ -233,6 +233,6 @@ export default function PreviewPRForm({
233233
onSubmit={handleSubmit}
234234
submitText="Preview"
235235
/>
236-
</div>
236+
</form>
237237
);
238238
}

0 commit comments

Comments
 (0)