mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-24 01:07:50 +00: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'),
|
key: new PluginKey('handle-node-uuid-click-plugin'),
|
||||||
props: {
|
props: {
|
||||||
handleClick (view, pos) {
|
handleClick (view, pos) {
|
||||||
|
const from = Math.max(0, pos - 1)
|
||||||
|
const to = Math.min(view.state.doc.content.size, pos + 1)
|
||||||
const markRanges =
|
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
|
(markRange) => markRange.mark.type.name === NAME && markRange.from <= pos && markRange.to >= pos
|
||||||
) ?? []
|
) ?? []
|
||||||
let nodeUuid: string | null = null
|
let nodeUuid: string | null = null
|
||||||
|
Loading…
Reference in New Issue
Block a user