mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-29 17:14:37 +03:00
UBERF-4304 UBER-1135 Fix nodeUuid extension exception when clicking below document (#4194)
Signed-off-by: Alexander Onnikov <alexander.onnikov@xored.com>
This commit is contained in:
parent
2bf1a03907
commit
48351893b1
@ -115,8 +115,10 @@ export const NodeUuidExtension = Mark.create<NodeUuidOptions, NodeUuidStorage>({
|
||||
key: new PluginKey('handle-node-uuid-click-plugin'),
|
||||
props: {
|
||||
handleClick (view, pos) {
|
||||
const from = Math.max(0, pos - 1)
|
||||
const to = Math.min(view.state.doc.content.size, pos + 1)
|
||||
const markRanges =
|
||||
getMarksBetween(Math.max(0, pos - 1), pos + 1, view.state.doc)?.filter(
|
||||
getMarksBetween(from, to, view.state.doc)?.filter(
|
||||
(markRange) => markRange.mark.type.name === NAME && markRange.from <= pos && markRange.to >= pos
|
||||
) ?? []
|
||||
let nodeUuid: string | null = null
|
||||
|
Loading…
Reference in New Issue
Block a user