Issue Overview
When inserting a value via JavaScript into a text field in a form in the editor-meta-boxes-area div in Gutenberg doesn't trigger the changedMetaBoxState() function to mark the metabox-contained data dirty.
In this instance, I've created a gallery CPT - a meta box contains thumbnails of any previously selected images, add/edit/remove buttons, and a hidden field that contains a json-encoded string of selected image IDs. I use the wp.media.frames.file_frame update event to update the content of the hidden field with the IDs of the selected images. However, isDirty is not set to true when the value is updated. If I type directly into the field, the value of isDirty is updated as expected.
Steps to Reproduce (for bugs)
- Create a metabox (old-school style) with a text field.
- Update the value of the field via JavaScript.
Expected Behavior
isDirty is set to true and the value of the field is saved on Update.
Current Behavior
Nothing. IsDirty is not set to true and the editor doesn't know it needs to save the metabox data. Again, if you type directly into the field everything works as expected.
Issue Overview
When inserting a value via JavaScript into a text field in a form in the editor-meta-boxes-area div in Gutenberg doesn't trigger the changedMetaBoxState() function to mark the metabox-contained data dirty.
In this instance, I've created a gallery CPT - a meta box contains thumbnails of any previously selected images, add/edit/remove buttons, and a hidden field that contains a json-encoded string of selected image IDs. I use the wp.media.frames.file_frame update event to update the content of the hidden field with the IDs of the selected images. However, isDirty is not set to true when the value is updated. If I type directly into the field, the value of isDirty is updated as expected.
Steps to Reproduce (for bugs)
Expected Behavior
isDirty is set to true and the value of the field is saved on Update.
Current Behavior
Nothing. IsDirty is not set to true and the editor doesn't know it needs to save the metabox data. Again, if you type directly into the field everything works as expected.