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