mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 03:40:48 +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 {
|
||||
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) {
|
||||
return
|
||||
}
|
||||
|
@ -72,8 +72,7 @@ export function createTodoItemExtension (mode: TextEditorMode, ctx: any): AnyExt
|
||||
return SvelteNodeViewRenderer(ToDoItemNodeView, {
|
||||
contentAs: 'li',
|
||||
contentClass: 'todo-item',
|
||||
componentProps: { objectId, objectClass, objectSpace },
|
||||
ignoreMutation: () => true
|
||||
componentProps: { objectId, objectClass, objectSpace }
|
||||
})
|
||||
}
|
||||
}).configure({
|
||||
@ -90,7 +89,7 @@ export function createTodoListExtension (mode: TextEditorMode, ctx: any): AnyExt
|
||||
|
||||
return TodoListExtension.extend({
|
||||
addNodeView () {
|
||||
return SvelteNodeViewRenderer(ToDoListNodeView, { ignoreMutation: () => true })
|
||||
return SvelteNodeViewRenderer(ToDoListNodeView, {})
|
||||
}
|
||||
}).configure({
|
||||
HTMLAttributes: {
|
||||
|
Loading…
Reference in New Issue
Block a user