- Issue created by @bojan_dev
- Merge request !47Issue #3397637 Focusing back on CKEditor inserts the token in the wrong field β (Open) created by bojan_dev
- last update
almost 2 years ago 77 pass - Status changed to Needs review
almost 2 years ago 10:52am 30 October 2023 - π³π±Netherlands bojan_dev
There is a edge case were this issue is still occuring in an initial state, but this can be resolved when the
editor:attached
event lands in core, see: β¨ Trigger event when Text Editor is attached Needs workWe can then do:
$(document).on('editor:attached', function () { if (Drupal.CKEditor5Instances) { Drupal.CKEditor5Instances.forEach(function (editor) { editor.editing.view.document.on('change:isFocused', (event, data, isFocused) => { if (isFocused) { drupalSettings.tokenFocusedField = false; drupalSettings.tokenFocusedCkeditor5 = editor; } }); }) } });
- Status changed to Needs work
over 1 year ago 1:58pm 22 February 2024 - First commit to issue fork.
- π·π΄Romania andreic
I have a page for a client where both simple textareas and ckeditor textareas are used for different fields in different paragraphs and if I clicked first on a simple textarea field and then on ckeditor textarea field, the focus would not work and Token Browser would not insert toke values.
If I closed the token browser window and clicked again the ckeditor textarea, then it would work, but the first time after a page load, it does not.
I switched the checks in the MR (first check for tokenFocusedCkeditor5 and then for tokenFocusedField) and now it works without a problem.
- Status changed to Needs review
16 days ago 7:06pm 20 August 2025 - π²π½Mexico gnuget Puebla
I faced this today, but in a Layout Builder block.
The thing is, when an inline block is edited on the Layout Builder page, it automatically focuses on the first field, so the instruction
Click on the title field
step is not even necessary, it just doesnβt work at all. π₯²Hereβs a patch version of the PR in case someone needs it.