Problem/Motivation

Inserting tokens from token browser into CKEditor 5.

Steps to reproduce

Pre-requisites:
A text format with CKEditor 5 configured as the text editor (admin/config/content/formats)

1. Edit Basic Page body field: /admin/structure/types/manage/page/fields/node.page.body
2. Under default value, ensure the CKEditor 5 is displaying.
3. Position cursor in Default value text area.
4. Click: "Browse available tokens."
5. Click on a token to insert it.
Expected: Token is inserted into Default body value.
Actual: Popup with "First click a text field to insert your tokens into." is displayed.

Performing the same steps with a text format that isn't configured with CKEditor 5 results in the token being successfully inserted.

Additionally, if you position the cursor in another field and perform the above steps, then the token will be inserted into the other field.

Proposed resolution

Ensure the form element/selector is correctly set when the cursor is positioned in the CKeditor text area.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

CommentFileSizeAuthor
Screenshot 2023-02-20 at 11.43.57.png176.72 KBoliverpolden

Comments

oliverpolden created an issue. See original summary.

cilefen’s picture

Title: Ckeditor 5 focus and token browser » Token browser loses editor focus
Component: javascript » ckeditor5.module
Issue tags: -CKEditor in core, -available token list, -token +JavaScript
wim leers’s picture

Status: Active » Postponed (maintainer needs more info)

🤔 I'm confused why this is being reported as a bug in CKEditor 5? This sounds like a bug in this custom plugin?

wim leers’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)
Issue tags: -JavaScript +JavaScript

Closing due to lack of response after 9 months.