fix: update cursor status after setting page mode #588
This commit is contained in:
@@ -144,7 +144,10 @@ export class Cursor {
|
||||
cursorTop + cursorHeight - defaultOffsetHeight
|
||||
}px`
|
||||
// 模拟光标显示
|
||||
if (!isShow) return
|
||||
if (!isShow) {
|
||||
this.recoveryCursor()
|
||||
return
|
||||
}
|
||||
const isReadonly = this.draw.isReadonly()
|
||||
this.cursorDom.style.width = `${width * scale}px`
|
||||
this.cursorDom.style.backgroundColor = color
|
||||
|
||||
@@ -868,10 +868,19 @@ export class Draw {
|
||||
this.footer.recovery()
|
||||
this.zone.setZone(EditorZone.MAIN)
|
||||
}
|
||||
const { startIndex } = this.range.getRange()
|
||||
const isCollapsed = this.range.getIsCollapsed()
|
||||
this.render({
|
||||
isSubmitHistory: false,
|
||||
isSetCursor: false
|
||||
isSetCursor: true,
|
||||
curIndex: startIndex,
|
||||
isSubmitHistory: false
|
||||
})
|
||||
// 重新定位避免事件监听丢失
|
||||
if (!isCollapsed) {
|
||||
this.cursor.drawCursor({
|
||||
isShow: false
|
||||
})
|
||||
}
|
||||
// 回调
|
||||
setTimeout(() => {
|
||||
if (this.listener.pageModeChange) {
|
||||
|
||||
Reference in New Issue
Block a user