It should be possible to refresh size/position of widget partial mask via public API #3775
Labels
changelog:api
A changelog entry should be put in the API section of the changelog.
plugin:widget
The plugin which probably causes the issue.
status:confirmed
An issue confirmed by the development team.
type:feature
A feature request.
Milestone
Type of report
Feature request
Provide description of the new feature
This is a follow up of #3240, where we have introduce a possibility to mask only part of the widget (see also https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_plugins_widget.html#property-mask). However, as reported in https://www.drupal.org/project/drupal/issues/3064572#comment-13283354 by @wimleers, there is an issue with mask refreshing due to specific Drupal Entity Embed CKEditor 4 plugin.
The Drupal Entity Embed plugin works in a way that it asynchronously fetches the entity HTML content (which may be slightly different depending on the entity type) and so there are two issues:
widget.parts
before entity HTML is fetched. Since fetching happens after widget initialisation and parts are processed on widget initialisation it becomes problematic. So the exact issue is that parts selector can be defined but entity HTML is not there on widget initialisation and would not be find.I know the issue with parts was somehow workaround by manually updating
widget.parts
but it is not a perfect solution.To sum up, we need to enable handling cases where widget content is loaded asynchronously (after initialisation) and part of the loaded content is masked correctly.
Extracting method for refreshing mask should be just aliasing the private function we have now. Not sure about refreshing parts, since we need to check if refreshing parts after the widget is initialised doesn't break anything.
The text was updated successfully, but these errors were encountered: