Jump to content

[SOLVED] Event listener in InputfieldRockPageBuilder.js getting false positives for RPB content changes


Recommended Posts

Posted (edited)

Heyo,

Just ran into a conflict between RPB and other fields on the page. I'm using a custom inputfield that uses Quill as the editor. There's an event listener that is catching changes in an instance of a Quill input while the field is located outside of RPB blocks.

InputfieldRockPageBuilder.js  L327

// monitor inline ckeditor fields
$(document).on("blur keyup paste input", "[contenteditable]", function (e) {
  RockPageBuilder.changed(e);
});

Quill uses a contenteditable attribute for the editor so an instance of that field anywhere on the page is triggering a RPB field update event.

// monitor inline ckeditor fields
$(document).on("blur keyup paste input", ".rpb-item [contenteditable]", function (e) {
  RockPageBuilder.changed(e);
});

I scoped the event listener selector by adding .rpb-item and that kept it from firing when editing a Quill field, but I don't have any CKEditor fields to test whether that affects other fields.

"That fixed it for me, don't know if it breaks something for someone else." 😆

Edited by FireWire
Issue resolved
  • Like 1
Posted

Thx! I think your fix should be fine and at least did not cause any problems on my end. I've pushed it to v6.3.1

  • Thanks 1
  • FireWire changed the title to [SOLVED] Event listener in InputfieldRockPageBuilder.js getting false positives for RPB content changes

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...