Skip to content

Commit

Permalink
Merge branch 'main' into fix-facebook-signup
Browse files Browse the repository at this point in the history
  • Loading branch information
sshanzel authored Feb 6, 2025
2 parents 92c40a5 + ebe717f commit 70e1b08
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/shared/src/hooks/input/useMarkdownInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,13 @@ export const useMarkdownInput = ({
const onPaste: ClipboardEventHandler<HTMLTextAreaElement> = async (e) => {
const pastedText = e.clipboardData.getData('text');
if (isValidHttpUrl(pastedText)) {
e.preventDefault();
await onLinkPaste(pastedText);
return;
const cursor = getCursorType(textarea);

if (cursor === CursorType.Highlighted) {
e.preventDefault();
await onLinkPaste(pastedText);
return;
}
}

if (e.clipboardData.files?.length && isUploadEnabled) {
Expand Down

0 comments on commit 70e1b08

Please sign in to comment.