perf: ipad 发送消息后出现页面跳动的情况

This commit is contained in:
kuaifan 2024-05-01 10:52:52 +08:00
parent ed36d622ec
commit e325698899

View File

@ -951,23 +951,27 @@ export default {
}, },
scrollIntoActive() { scrollIntoActive() {
if (this.windowPortrait || this.windowScrollY > 0) {
return;
}
this.$nextTick(() => { this.$nextTick(() => {
if (this.windowLandscape && this.$refs.list) { if (!this.$refs.list) {
const active = this.$refs.list.querySelector(".active") return;
if (active) { }
$A.scrollIntoViewIfNeeded(active); const active = this.$refs.list.querySelector(".active")
} else { if (active) {
const dialog = this.cacheDialogs.find(({id}) => id == this.dialogId) $A.scrollIntoViewIfNeeded(active);
if (dialog && this.dialogActive) { return;
this.dialogActive = ''; }
this.$nextTick(() => { const dialog = this.cacheDialogs.find(({id}) => id == this.dialogId)
const active = this.$refs.list.querySelector(".active") if (dialog && this.dialogActive) {
if (active) { this.dialogActive = '';
$A.scrollIntoViewIfNeeded(active); this.$nextTick(() => {
} const active = this.$refs.list.querySelector(".active")
}); if (active) {
$A.scrollIntoViewIfNeeded(active);
} }
} });
} }
}) })
}, },