[19.0] document_url: opening the attachment box scrolls the chatter to the bottom

未关闭 适合新手
#664 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
94/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
javascript
领域
frontend

调研方向

阅读 static/src/js/url.esm.js,并结合 issue 中描述的 order="desc" 线程滚动行为,追踪 Chatter.onClickAddAttachments 的覆盖实现。将附件框的滚动值改为与 core mail 的 "bottom" 设置一致,然后验证打开附件框后,在线程重新计算滚动位置时 chatter 仍保持在顶部。

由索引模型根据 Issue 内容生成。

描述

bug

Module: document_url 19.0.1.0.0

Steps to reproduce

  1. Open any record with a chatter that has several messages and at least one attachment.
  2. Click the paperclip in the chatter topbar.
  3. As soon as the thread recomputes its scroll (an image finishes loading, a resize), the chatter jumps to the very bottom, which is the oldest message.

Cause
static/src/js/url.esm.js overrides Chatter.onClickAddAttachments and sets
this.state.thread.scrollTop = 0. The chatter renders the thread with order="desc",
and there Thread.applyScroll reads a numeric scrollTop as the distance from the end
(scrollHeight - scrollTop - clientHeight), so 0 means "bottom of the list".
Core mail sets this.state.thread.scrollTop = "bottom", which for desc means the top.

Fix

         if (this.state.isAttachmentBoxOpened) {
             this.rootRef.el.scrollTop = 0;
-            this.state.thread.scrollTop = 0;
+            this.state.thread.scrollTop = "bottom";
         }
主要语言
HTML
星标
256
派生
405
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

OCA/knowledge 的其他 Issue

查看 OCA/knowledge 的全部 Issue

相似的 Issue

更多 Web Dev Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。