Skip to content

Comments on dynamically added content do not work #33532

Closed
@McRaeAlex

Description

@McRaeAlex

Description

When content is dynamically added to the page and comments that are part of the dynamically added content do not have "full" behaviour.

For example when viewing a pull request which doesn't have all the files loaded (exceeds git.MAX_GIT_DIFF_FILES) then a "Show More" button appears at the bottom of the page. When the new file diffs are loaded they include their comments however the user isn't able to edit them.

To reproduce I suggest creating a design review with 2 files, adding a comment on the second and then setting git.MAX_GIT_DIFF_FILES=1 and reloading. This will force you to click "show more" and observe the behaviour when trying to edit the comment.

Problem

The event listener isn't being attached to the DOM for the the button. The eventHandler can be found at semantic.js:2391 (of the build output). I am working on figuring out where the event listener should be added but any help would be apprieciated.

Screenshots

Button thats not working

Image

Screen Recording

Screen.Recording.2025-02-07.at.12.23.13.PM.mov

Gitea Version

main, 1.23, 1.22

Can you reproduce the bug on the Gitea demo site?

Yes but due to git.MAX_GIT_DIFF_FILES being rather large its easier to do locally.

Operating System

No response

Browser Version

Chrome, Firefox latest

Metadata

Metadata

Assignees

Labels

topic/uiChange the appearance of the Gitea UItype/bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions