瀏覽代碼

Defer scrollIntoView after DOM is drawn (fixes #8239) (#8242)

master
ThibG 5 年之前
committed by Eugen Rochko
父節點
當前提交
4601a58ac2
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. +3
    -1
      app/javascript/mastodon/features/status/index.js

+ 3
- 1
app/javascript/mastodon/features/status/index.js 查看文件

@@ -355,7 +355,9 @@ export default class Status extends ImmutablePureComponent {
if (status && ancestorsIds && ancestorsIds.size > 0) {
const element = this.node.querySelectorAll('.focusable')[ancestorsIds.size - 1];

element.scrollIntoView(true);
window.requestAnimationFrame(() => {
element.scrollIntoView(true);
});
this._scrolledIntoView = true;
}
}


Loading…
取消
儲存