Skip to content

Load on the fly #418

@Mte90

Description

@Mte90

So reading the code on https://github.com/danirus/django-comments-xtd/blob/master/django_comments_xtd/static/django_comments_xtd/js/src/index.js#L6

Seems that if the selector doesn't exist there is a JS crash (I can confirm it) but also if the comments are loaded after the library loading this is not possible (remember #334).

My user case is that I have the comments in some pages but in others they are showed after a clicked (loaded with HTMX so they aren't in the HTML yet).
Ideally this cose should check in runtime for new items, also the problem is that natively uses the ID that need to be unique.

I will work on a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions