Fix(评论):苹果13 15 16,点击回复的时候光标是停留在@符号后面,要再点击一次光标才会停留到整个昵称后面

This commit is contained in:
lifizer
2025-07-16 10:07:39 +08:00
parent 8bd83e7c7f
commit 4aeed9292b
+10 -8
View File
@@ -183,14 +183,16 @@ export default {
showSendBtn(item) { showSendBtn(item) {
// 显示发送按钮 // 显示发送按钮
this.showBtn = true this.showBtn = true
// 延迟100ms,否则无法聚焦 this.currentComment = item
setTimeout(() => { this.content = '@' + item.senderUserNickname + ' '
// 自动聚焦 this.$nextTick(() => {
this.autoFocus = true // 延迟100ms,否则无法聚焦
this.currentComment = item setTimeout(() => {
this.content = '@' + item.senderUserNickname + ' ' // 自动聚焦
this.cursorIndex = this.content.length this.autoFocus = true
}, 100) this.cursorIndex = this.content.length
}, 100)
})
}, },
/** /**
* 失焦 * 失焦