Skip to content

[19.0][FIX] document_url: keep chatter at top when opening attachments - #665

Open
marketingorganoid-source wants to merge 1 commit into
OCA:19.0from
marketingorganoid-source:19.0-fix-document_url-scroll
Open

marketingorganoid-source wants to merge 1 commit into
OCA:19.0from
marketingorganoid-source:19.0-fix-document_url-scroll

Conversation

@marketingorganoid-source

Copy link
Copy Markdown

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
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".

Fix
Use "bottom" like core mail does in onClickAddAttachments, which for a descending thread means the top (newest message).

Reproduced on Odoo 19.0 with document_url 19.0.1.0.0: chatter scrollTop went from 0 to the maximum after opening the attachment box; with this change it stays at 0.

🤖 Generated with Claude Code

The chatter renders its thread with order="desc". There a numeric
thread.scrollTop is read as the distance from the end, so setting it
to 0 made the chatter jump to the oldest message as soon as the thread
recomputed its scroll (image loaded, resize). Use "bottom" like core
mail does, which means the top for a descending thread.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oca-cla-bot

oca-cla-bot Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants