Problem/Motivation

The Table Element in the Wyswyg Text Editor is not usable, because its Table properties cannot be edited (don't get focus)

Steps to reproduce

Add a Paragraph Component with a Text Field with a Wysywyg Text Editor containing the Table element, and adding/editing this component just try to add and edit a Table component (@see the attached screenshot).
This doesn't happen with the same Wysywyg Text Editor not managed throughout the Layout Paragraphs Widget dialog ...

Comments

itamair created an issue. See original summary.

itamair’s picture

Title: Table Element not usable in the Wysywyg Text Editor » Table Element not usable in the Wysywyg Text Editor, throughout LP Widget dialog
dk-massive’s picture

CKeditor disables interactions with anything outside the current dialog. That unfortunately includes the new dialog window popping up with the table. This is a duplicate of this issue in core: https://www.drupal.org/project/drupal/issues/3065095#comment-13311079

Comment 17 solved this on my end. Their solution was to add that snippet Knaffles mentions with a module. I think they did not patch it in due to CKeditor/jquery.iu being a third party library and maintained outside of Drupal.

I went ahead and created a quick patch that adds this to Layout Paragraphs so you won't have to create a custom module to add the script.

itamair’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new840 bytes

thanks @dk-massive. I tested and reviewed it and your patch really fixes the issue.
I just amended with a comment to the added behaviour (so to make more clear what it does and what drupal issue is fixing),
and also changed its naming into a more appropriate drupal patches naming convention.
I mark this a RTBC ...

  • itamair committed 28052f3 on 1.0.x authored by dk-massive
    Issue #3196477 by itamair, dk-massive: Table Element not usable in the...
itamair’s picture

Status: Reviewed & tested by the community » Fixed

Committed into dev ...

itamair’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

donquixote’s picture

The way that Drupal.behaviors is used here looks wrong.

Keep in mind that Drupal.behaviors is called again, each time a new element is added to the DOM tree!

itamair’s picture

Status: Closed (fixed) » Needs work

hence, let's reopen this, for a better implementation.
Thanks @donquixote.
May you provide here a correcting patch?

Are you minding about this last Drupal.behaviors.allowChildDialogInteraction , or also the Drupal.behaviors.layoutParagraphsWidget?
I don't get if you wanna merge the Drupal.behaviors.allowChildDialogInteraction code into the Drupal.behaviors.layoutParagraphsWidget or provide it with a "once" or whatever? ...

Some further hints/suggestion may help this fix ... :-)

donquixote’s picture

I only had a superficial look at this, coming from another issue.

The main question is what should this code accomplish, and when do you want it to execute?
- One time on page load, OR
- Every time a new piece of html is added to the page?

itamair’s picture

Status: Needs work » Needs review
StatusFileSize
new1.06 KB

You are right, @donquixote ... we don't need the Drupal.behaviour here, as that code need to be loaded just on page load,
and it is working fine also with this new patch setup.
In fact all the solutions mentioned in this related core issue: https://www.drupal.org/project/drupal/issues/3065095 are not embedding that code in the Drupal.behaviour too.

  • itamair committed a9c988c on 1.0.x
    Issue #3196477 by itamair, dk-massive: Table Element not usable in the...
itamair’s picture

#12 Patch committed into dev, will be part of the next release.

itamair’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.