Initial Drupal Behaviors not attached after new content load

Created on 1 October 2020, over 4 years ago
Updated 23 June 2023, almost 2 years ago

Problem/Motivation

Whenever I load more content from the view, all initially set JQuery behaviors are lost. I can get around this by adding Drupal.attachbehaviors();
following line 52 of infinite_scroll.js. I know this is a very crude solution and am looking for the correct way to retain Drupal behaviors following new loaded content.

Any advice regarding this would be greatly appreciated, thank you.

Steps to reproduce

Once I load new content with from the infinite scroll view, all JQuery behaviors cease to work.

Proposed resolution

Adding Drupal.attachbehaviors(); following line 52 "Drupal.attachBehaviors(view.$view[0]); " on infnite_scroll.js fixes this for me.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Postponed: needs info

Version

1.7

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Alex Tenczar

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Is this still an issue with 2.0.x? If yes, please update the version and set the status active again with clear steps or (best) with a test showing what's broken.

    2.0.x is the active development branch.

    If nobody replies, we should assume this is fixed and close this issue outdated.

    Thanks!

Production build 0.71.5 2024