a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix some iffy link clicking logic

+6 -6
+6 -6
components/Blocks/TextBlock/index.tsx
··· 223 223 let handlePaste = useHandlePaste(props.entityID, propsRef, factID); 224 224 let handleClickOn = useCallback< 225 225 Exclude<Parameters<typeof ProseMirror>[0]["handleClickOn"], undefined> 226 - >((view, _pos, node, _nodePos) => { 227 - if (node.nodeSize - 1 <= _pos) return; 228 - let mark = node 229 - .resolve(_pos) 230 - .marks() 231 - .find((f) => f.type === schema.marks.link); 226 + >((view, _pos, node, _nodePos, _event, direct) => { 227 + if (!direct) return; 228 + if (node.nodeSize - 2 <= _pos) return; 229 + let mark = 230 + node.nodeAt(_pos - 1)?.marks.find((f) => f.type === schema.marks.link) || 231 + node.nodeAt(_pos - 2)?.marks.find((f) => f.type === schema.marks.link); 232 232 if (mark) { 233 233 window.open(mark.attrs.href, "_blank"); 234 234 }