Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

editor: press enter in link popup to insert link (#4423)

Muhammad Alic15410e168d3
diff --git a/packages/editor/src/toolbar/popups/link-popup.tsx b/packages/editor/src/toolbar/popups/link-popup.tsx
index 10161e2fc..f71cb7066 100644
--- a/packages/editor/src/toolbar/popups/link-popup.tsx
+++ b/packages/editor/src/toolbar/popups/link-popup.tsx
@@ -46,13 +46,17 @@ export function LinkPopup(props: LinkPopupProps) {
onClose={onClose}
action={{
title: isEditing ? "Save edits" : "Insert link",
- onClick: () => {
- if (!link.current) return;
- onDone(link.current);
- }
+ onClick: () => onDone(link.current)
}}
>
- <Flex sx={{ p: 1, flexDirection: "column", width: ["auto", 250] }}>
+ <Flex
+ sx={{ p: 1, flexDirection: "column", width: ["auto", 250] }}
+ onKeyUp={(e) => {
+ if (e.key === "Enter") {
+ onDone(link.current);
+ }
+ }}
+ >
{!isImageActive && (
<Input
type="text"