liferay / liferay-ckeditor

Other
8 stars 49 forks source link

fix: LPS-136119 We can't open panel elements when the table toolbar is re-rendered #188

Closed markocikos closed 3 years ago

markocikos commented 3 years ago

Fixes: https://issues.liferay.com/browse/LPS-136119

To reproduce:

  1. Place frontend-editor-ckeditor-sample-web on a page.
  2. See movies of the bug the linked ticket.
  3. Comment out this block of code, overriding of CKEDITOR.ui.panel.prototype.showBlock. This block is inadequate to fix this issue, and prevents the solution in this PR to work correctly.

The root cause of the issue is that id of buttons is changing with each render. On the other side, blocks are tied to id of the button that created them. addBlock sets this._.blocks[ name ] only on creation. With the seconds render, link through id is lost.

Notes:

After PR: after