fix: update cursor status after setting page mode #588

pr675
Hufe921 2 years ago
parent 8f36d1fb4f
commit 28596c889f

@ -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) {

Loading…
Cancel
Save