tinymce / tinymce-angular

Official TinyMCE Angular Component
MIT License
320 stars 92 forks source link

INT-2974: Support OnPush change detection #368

Closed danoaky-tiny closed 3 months ago

danoaky-tiny commented 5 months ago

Jira: INT-2974

Description of changes: As described in #311, when a parent component was using OnPush change detection, changes made in the editor component weren't picked up.

This is fixed by changing the editor's change detection strategy to use OnPush itself, and marking when changes need to be checked manually. Changes are marked to be checked on the editor's blur event and on any of the modelEvents. This covers both for checking when "touched" and when made "dirty".

I've also added a Storybook component to show this functionality.

Note: ~This PR depends on changes in #367, so merge that first.~ Moved the base to feature-INT-3274. So this is being merged first now.