fix: reset event ability after delete element #314
This commit is contained in:
@@ -641,6 +641,10 @@ export class Draw {
|
||||
return this.canvasEvent
|
||||
}
|
||||
|
||||
public getGlobalEvent(): GlobalEvent {
|
||||
return this.globalEvent
|
||||
}
|
||||
|
||||
public getListener(): Listener {
|
||||
return this.listener
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ export function keydown(evt: KeyboardEvent, host: CanvasEvent) {
|
||||
curIndex = isCollapsed ? index - 1 : startIndex
|
||||
}
|
||||
if (curIndex === null) return
|
||||
draw.getGlobalEvent().setCanvasEventAbility()
|
||||
rangeManager.setRange(curIndex, curIndex)
|
||||
draw.render({ curIndex })
|
||||
} else if (evt.key === KeyMap.Delete) {
|
||||
@@ -80,6 +81,7 @@ export function keydown(evt: KeyboardEvent, host: CanvasEvent) {
|
||||
curIndex = isCollapsed ? index : startIndex
|
||||
}
|
||||
if (curIndex === null) return
|
||||
draw.getGlobalEvent().setCanvasEventAbility()
|
||||
rangeManager.setRange(curIndex, curIndex)
|
||||
draw.render({ curIndex })
|
||||
} else if (evt.key === KeyMap.Enter) {
|
||||
|
||||
Reference in New Issue
Block a user