Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
fix: clicking bottom of page doesn't always unselect current selection (#3862)
Wolf Mermelsteind696b03dc38c
diff --git a/js/app/packages/core/component/LexicalMarkdown/component/core/FocusClickTarget.tsx b/js/app/packages/core/component/LexicalMarkdown/component/core/FocusClickTarget.tsxindex c896e48380..686c6b0867 100644--- a/js/app/packages/core/component/LexicalMarkdown/component/core/FocusClickTarget.tsx+++ b/js/app/packages/core/component/LexicalMarkdown/component/core/FocusClickTarget.tsx@@ -17,7 +17,16 @@ export function FocusClickTarget(return (<divonMouseDown={(e: MouseEvent) => {- e.preventDefault(); // this div should not take focus.+ // don't prevent default when there's an active selection+ // since the expected behavior is that it unselects+ let hasActiveSelection = false;+ local.editor.getEditorState().read(() => {+ const sel = $getSelection();+ hasActiveSelection = $isRangeSelection(sel) && !sel.isCollapsed();+ });+ if (!hasActiveSelection) {+ e.preventDefault();+ }}}classList={{'invisible-focus-target': true,