diff --git a/frontend/src/scenes/notebooks/Notebook/InlineMenu.tsx b/frontend/src/scenes/notebooks/Notebook/InlineMenu.tsx index e834c5771b277..412dc216dba01 100644 --- a/frontend/src/scenes/notebooks/Notebook/InlineMenu.tsx +++ b/frontend/src/scenes/notebooks/Notebook/InlineMenu.tsx @@ -2,6 +2,7 @@ import { LemonButton, LemonInput } from '@posthog/lemon-ui' import { Editor, isTextSelection } from '@tiptap/core' import { BubbleMenu } from '@tiptap/react' import { IconBold, IconDelete, IconItalic, IconLink, IconOpenInNew } from 'lib/lemon-ui/icons' +import { isURL } from 'lib/utils' export const InlineMenu = ({ editor }: { editor: Editor }): JSX.Element => { const { href, target } = editor.getAttributes('link') @@ -28,7 +29,7 @@ export const InlineMenu = ({ editor }: { editor: Editor }): JSX.Element => { return state.doc.textBetween(from, to).length > 0 }} > -
+
{editor.isActive('link') ? ( <> { className="border-0" autoFocus /> - } status="primary" size="small" /> + } + status="primary" + size="small" + disabledReason={!isURL(href) && 'Enter a URL.'} + /> editor.chain().focus().unsetMark('link').run()} icon={}