- Issue created by @edwardsay
- Status changed to Postponed: needs info
about 1 year ago 10:17am 15 February 2024 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Thanks for taking the time to report this in detail, @edwardsay! 😊
Please check #3415961-6: [drupalMedia] Using the Insert Media button causes the window to scroll to the bottom of the page → — can you apply a similar one-line change to the https://www.drupal.org/project/ckeditor_templates → module you demonstrated in the GIF (thanks!) to check if that fixes the problem? 🙏
- 🇺🇸United States edwardsay
Thank you Wim Leers.
Unfortunately, the fix from https://www.drupal.org/comment/15443030#comment-15443030 → does not resolve the issue related to the jQuery focus event, triggered on the CKE buttons.
This "jump issue" can be reproduced not only in CKE-Templates dialogs, but all dialogs.
- Status changed to Needs work
about 1 year ago 3:27pm 21 March 2024 - 🇺🇸United States edwardsay
Even the closing of the dialog triggers the refocus and scroll. A new GIF is attached.
- First commit to issue fork.
We've used the workaround described at the top of this page, and now there is no scrolling up after inserting a media item into the text. That is a big improvement, thank you to @edwardsay
The workaround has introduced another problem though, as after inserting media the CKE toolbar is now hidden (I think due to the focus leaving the CKE text area). When the user clicks into the CKE text area to continue editing, the CKE toolbar displays again. This repeated hide / display of the toolbar is distracting to the user, so it'll be good to find a way to stop it from happening. (It did not happen when we used D9.5.9+CKE4.)
Can CKE's 'Link' button give any clues to a solution? After using it to add a link to text, the page doesn't scroll and the CKE toolbar isn't hidden. An extra advantage is that after using the Link button the focus remains in the CKE text area, so that a user can immediately continue typing without having to click into the CKE text area first.
Background: We hit this problem while upgrading our site from D9 to D10. We have over 30,000 photos on our site and users often use the 'Insert Media' button when editing pages or comments. This 'scroll up' bug first appeared when, in preparation for the upgrade, we switched our D9.5.9 site from using CKEditor 4 to CKE5.
Then we upgraded core from D9.5.9 to D10.2.2, which introduced the 'scroll down' bug described in issue 3415961, [drupalMedia] Using the Insert Media button causes the window to scroll to the bottom of the page 🐛 [drupalMedia] Using the Insert Media button causes the window to scroll to the bottom of the page Needs work . We fixed it by applying patch #5 from that issue, but that meant this issue's bug resurfaced, and so after inserting media the page scrolled up again.