authorgravatar for 97427849+flamboh@users.noreply.github.comoliver <97427849+flamboh@users.noreply.github.com> 2026-09-10 11:37:35-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-10 15:37:35-03:00
log60eff99f25dbfc9799043ad979537e2da1aea590
tree2ee79c0cffa6f9f6de30283b5d0cf4559aaf783f
parent3997b9a3a4ee6b43ee768a9b372ff3dd52fd840e
signature Signed by PGP key B5690EEEBB952194

fix(web): save PR body edits with Cmd/Ctrl+Enter (#10660)


1 files changed, 14 insertions(+), 6 deletions(-)

apps/web/src/components/pullRequest/PullRequestMarkdownEditor.tsx+14-6
......@@ -55,11 +55,24 @@ export function PullRequestMarkdownEditor({
5555 setDraft(value);
5656 }
5757 const empty = draft.trim().length === 0;
58 const saveDisabled = saving || (empty && !allowEmpty);
5859
5960 return (
6061 <div
6162 className={cn("space-y-2", className)}
6263 onKeyDown={(event) => {
64 if (event.nativeEvent.isComposing || event.keyCode === 229) return;
65 if (
66 event.key === "Enter" &&
67 (event.metaKey || event.ctrlKey) &&
68 !event.shiftKey &&
69 !event.altKey
70 ) {
71 event.preventDefault();
72 event.stopPropagation();
73 if (!saveDisabled && !event.repeat) onSave(draft);
74 return;
75 }
6376 if (event.key !== "Escape" || saving) return;
6477 event.preventDefault();
6578 onCancel();
......@@ -106,12 +119,7 @@ export function PullRequestMarkdownEditor({
106119 <Button size="xs" variant="ghost" disabled={saving} onClick={onCancel}>
107120 Cancel
108121 </Button>
109 <Button
110 size="xs"
111 variant="outline"
112 disabled={saving || (empty && !allowEmpty)}
113 onClick={() => onSave(draft)}
114 >
122 <Button size="xs" variant="outline" disabled={saveDisabled} onClick={() => onSave(draft)}>
115123 {saving ? "Saving..." : "Save"}
116124 </Button>
117125 </div>