MCPcopy Create free account
hub / github.com/dailydotdev/apps / onLinkClick

Function onLinkClick

packages/shared/src/components/utilities/SelectableLink.tsx:19–26  ·  view source on GitHub ↗
(e: React.MouseEvent)

Source from the content-addressed store, hash-verified

17 children,
18}: SelectableLinkProps): ReactElement {
19 const onLinkClick = (e: React.MouseEvent) => {
20 const selection = globalThis?.window?.getSelection();
21 const hasSelection = selection?.anchorOffset !== selection?.focusOffset;
22
23 if (hasSelection) {
24 e.preventDefault();
25 }
26 };
27
28 return (
29 <Link href={href} {...linkProps}>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected