- 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
about 1 year ago 77 pass - Status changed to Needs review
about 1 year 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
10 months 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.