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

Đang mở Phù hợp với người mới
#664 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
94/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript
Lĩnh vực
frontend

Hướng nghiên cứu

Đọc static/src/js/url.esm.js và theo dõi phần ghi đè Chatter.onClickAddAttachments cùng với hành vi cuộn của thread có order="desc" được mô tả trong issue. Thay đổi giá trị cuộn của hộp đính kèm để khớp với thiết lập "bottom" của core mail, sau đó xác minh rằng khi mở hộp, chatter vẫn ở trên cùng sau khi thread tính toán lại vị trí cuộn.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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";
         }
Ngôn ngữ chính
HTML
Star
256
Fork
405
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của OCA/knowledge

Tất cả issue của OCA/knowledge

Issue tương tự

Thêm issue về Web Dev

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.