Jump to content

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


FireWire
 Share

Recommended Posts

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." 😆

  • Like 1
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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