Inline block drawer doesn’t open when inserting a inline block
Describe the Bug
When inserting a inline-block into a rich-text field it is added immediately without opening the drawer first
Link to the code that reproduces this issue
https://github.com/shefing/payload_Inline_block_with_relationship/tree/Check_inline_block
Reproduction Steps
Steps to reproduce:
- Clone the link to reproduction ripo and launch Payload
- Create a new Post instance
- Add a inline-block to the rich-text field
Expected: Inline-block drawer is opened
Actual: Inline-block drawer doesn’t open and a empty inline-block is added in the rich-text field
Which area(s) are affected? (Select all that apply)
plugin: richtext-lexical
Environment Info
Payload: 3.1.0
Node.js: 22.11.0
Next.js: 15.0.3
Additional related bug: When there are two types of inline-blocks in the rich-text field, the drawer that opens for both of them (when clicking on the edit icon) is the one that was added last .
Steps to reproduce:
- Clone the link to reproduction ripo and launch Payload (another commit was added for this part)
- Create a new Post instance
- Add inline-block 'MyInlineBlock' to the rich-text field
- Add inline-block 'MyInlineBlock2' to the rich-text field
- Click on the 'MyInlineBlock' edit icon
Expected: Inline-block drawer for 'MyInlineBlock' is opened
Actual: Inline-block drawer for 'MyInlineBlock2' is opened
In addition, when editing an inline block in the drawer, it appears to open drawers for all the instances of the specific inline block, that exist in the current lexical richtext editor. For example, when adding two inline blocks of the same type and then opening a drawer, both of the drawers actually appear on top of each other.
This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.
🚀 This is included in version v3.3.0
https://github.com/payloadcms/payload/issues/9816