Running javascript every time a paragraph instance is added or removed

Created on 4 March 2019, almost 6 years ago
Updated 10 September 2024, 5 months ago

I've got a paragraph field in my content type. The user can add any number of paragraph instances to this field.

I have my custom module set up to run JS on the page.

Is there an accepted way of firing off some js on the page every time a paragraph instance is either added or removed by the user?

Many thanks!

💬 Support request
Status

Active

Version

1.6

Component

Code

Created by

🇬🇧United Kingdom magwag

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.

  • @magwag Did you ever find a nice way for this?

  • Status changed to Fixed 3 months ago
  • 🇨🇭Switzerland berdir Switzerland

    Any added or removed paragraph is an ajax operation and it will automatically call all behaviors again on the whole widget. It's not a direct event or anything, but combined with a once() you should be able to act on paragraph changes.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024