fix(richtext-lexical): inline blocks and tables not functioning correctly if they are used in more than one editor on the same page (#7665)

Fixes https://github.com/payloadcms/payload/issues/7579

The problem was that multiple richtext editors shared the same drawer
slugs for the table and inline block drawers.
This commit is contained in:
Alessio Gravili
2024-08-13 21:46:23 -04:00
committed by GitHub
parent 352ed0ebef
commit fca4ee995e
4 changed files with 54 additions and 23 deletions

View File

@@ -482,7 +482,9 @@ describe('lexicalMain', () => {
// Click on button with class lexical-upload__upload-drawer-toggler
await newUploadNode.locator('.lexical-upload__upload-drawer-toggler').first().click()
const uploadExtraFieldsDrawer = page.locator('dialog[id^=drawer_1_upload-drawer-]').first()
const uploadExtraFieldsDrawer = page
.locator('dialog[id^=drawer_1_lexical-upload-drawer-]')
.first()
await expect(uploadExtraFieldsDrawer).toBeVisible()
await wait(500)
@@ -508,7 +510,7 @@ describe('lexicalMain', () => {
await expect(reloadedUploadNode).toBeVisible()
await reloadedUploadNode.locator('.lexical-upload__upload-drawer-toggler').first().click()
const reloadedUploadExtraFieldsDrawer = page
.locator('dialog[id^=drawer_1_upload-drawer-]')
.locator('dialog[id^=drawer_1_lexical-upload-drawer-]')
.first()
await expect(reloadedUploadExtraFieldsDrawer).toBeVisible()
await wait(500)