mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-21 15:59:15 +00:00
EZQMS-1232 Fix todo items selection (#7225)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
parent
9f261a19d3
commit
c91e3c2554
@ -150,8 +150,13 @@ class SvelteNodeView extends NodeView<SvelteNodeViewComponent, Editor, SvelteNod
|
|||||||
|
|
||||||
handleSelectionUpdate (): void {
|
handleSelectionUpdate (): void {
|
||||||
const { from, to } = this.editor.state.selection
|
const { from, to } = this.editor.state.selection
|
||||||
|
const pos = this.getPos()
|
||||||
|
|
||||||
if (from <= this.getPos() && to >= this.getPos() + this.node.nodeSize) {
|
if (typeof pos !== 'number') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (from <= pos && to >= pos + this.node.nodeSize) {
|
||||||
if (this.renderer.props.selected === true) {
|
if (this.renderer.props.selected === true) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -72,8 +72,7 @@ export function createTodoItemExtension (mode: TextEditorMode, ctx: any): AnyExt
|
|||||||
return SvelteNodeViewRenderer(ToDoItemNodeView, {
|
return SvelteNodeViewRenderer(ToDoItemNodeView, {
|
||||||
contentAs: 'li',
|
contentAs: 'li',
|
||||||
contentClass: 'todo-item',
|
contentClass: 'todo-item',
|
||||||
componentProps: { objectId, objectClass, objectSpace },
|
componentProps: { objectId, objectClass, objectSpace }
|
||||||
ignoreMutation: () => true
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).configure({
|
}).configure({
|
||||||
@ -90,7 +89,7 @@ export function createTodoListExtension (mode: TextEditorMode, ctx: any): AnyExt
|
|||||||
|
|
||||||
return TodoListExtension.extend({
|
return TodoListExtension.extend({
|
||||||
addNodeView () {
|
addNodeView () {
|
||||||
return SvelteNodeViewRenderer(ToDoListNodeView, { ignoreMutation: () => true })
|
return SvelteNodeViewRenderer(ToDoListNodeView, {})
|
||||||
}
|
}
|
||||||
}).configure({
|
}).configure({
|
||||||
HTMLAttributes: {
|
HTMLAttributes: {
|
||||||
|
Loading…
Reference in New Issue
Block a user