Problem/Motivation
Hi, this module uses a subscription to the change event to determine if the form has been edited, but some specific updates do not trigger this event, so the core has its own formUpdated event for form updates.
One example where this causes a problem is editing in CKEditor5, but switching to the formUpdated event will solve the problem.
This will also remove the iteration of all CKEditor4 instances.
And will solve the problem when one of these instances calls a dialog, although it is not in a form.
Steps to reproduce
- Create a form with CKEditor5.
- Include modified-form-alert.js to the form.
- Enter something in CKEditor5.
- Try to close the browser tab, it will close successfully without warning.
Proposed resolution
Subscribe to formUpdated event instead of chage in modified-form-alert.js
Remaining tasks
Fix.
User interface changes
None.
API changes
None.
Data model changes
None.
Issue fork modified_form_alert-3466302
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
kksandr commentedComment #5
kksandr commentedThis event was added to editors in version 8.0-alpha3~680 11 years ago, so it is compatible with Drupal 8 which the module claims to support.
Comment #6
anruetherThanks for the MR! I applied the commits as patches to our project and it works fine.
Comment #7
jeroentMerged to 2.1.x. Thanks!