Whenever any html is added or removed from the page Drupal.attachBehaviors should be run on the new html that way other behaviors can attach to it.

Here is a patch for that.

Comments

Scott Reynolds’s picture

StatusFileSize
new2.65 KB

I release that clicking the x to remove a tag no longer worked :-D here is a fix for that.

dragonwize’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Needs review » Needs work

This is good work but I see several issues.

  1. We can not use .parent() for .prev() because it will cause all taxonomy fields to change when you have more than 1 taxonomy field enabled.
  2. There is no need for an attachBehaviors call in activeTagsUpdate because no html is being removed or added there. Only the value of a textfield is being changed.
  3. I am really lost in why all the changes to the remove functionality were needed. What purpose does it serve?
  4. The patch needs to be rerolled against the latest 2.x branch.

Thanks.

Scott Reynolds’s picture

We can not use .parent() for .prev() because it will cause all taxonomy fields to change when you have more than 1 taxonomy field enabled.

Doh! could call

There is no need for an attachBehaviors call in activeTagsUpdate because no html is being removed or added there. Only the value of a textfield is being changed.

So then in the remove click function then, it should attachBehaviors.

I am really lost in why all the changes to the remove functionality were needed. What purpose does it serve?

It created an infinite loop as it called activeTagsUpdate() which then calls attachBehaviors.

mahyarsbt’s picture

Assigned: Unassigned » mahyarsbt
Issue summary: View changes
Status: Needs work » Fixed

Thank you for your continued interest in the Active Tags module.

We are excited to announce that the issue you raised has been addressed in the revitalized Active Tags version 1.0.0. This update supports Drupal 9, 10, and 11 and brings a modern interface along with a range of new features to enhance your Drupal tagging experience, including:

  • Enhanced Tag Styling: Enjoy a modern and visually appealing interface for entity reference fields.
  • Dynamic Tag Creation: Flexibly enable or disable tag creation based on your Drupal settings.
  • Support for User Avatars: Display user avatars in tags when using the User entity autocomplete.
  • Efficient Tag Management: Organize tags effortlessly with drag-and-sort functionality, duplicate protection, and multiple selection support.
  • Entity ID Display: Optionally display the entity ID alongside each tag for added clarity.
  • Integration with Key Modules: Seamlessly integrate with Token, Webform, Facets, and Better Exposed Filters for enhanced filtering and autocomplete functionality.

This is just a glimpse of the new capabilities. We encourage you to explore these new features by downloading the latest version. For a full list of features and more details, please visit the Active Tags project page.

mahyarsbt’s picture

Status: Fixed » Closed (fixed)

With the release of Active Tags 1.0.0, we believe this issue has been fully resolved. We invite you to explore the latest version and share any feedback you have.

Thank you for your continued support and contributions to the Drupal community. Together, we can keep improving Active Tags!


Visit the Active Tags project page to stay updated and provide feedback.