- Issue created by @morganlyndel
- Status changed to Postponed: needs info
12 months ago 1:38pm 12 February 2024 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
I cannot reproduce this. In which browser is this happening?
- 🇮🇳India gouthamraon
We are also facing the same issue.
After upgrading site to 10.2.2, we are seeing this issue.
@wim-leers : I tried this in Chrome and Firefox, both i'm seeing this issue.
- Status changed to Needs review
12 months ago 8:01am 15 February 2024 - Status changed to Needs work
12 months ago 10:15am 15 February 2024 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Thank you very much for pushing this forward, @gouthamraon! 😊
AFAICT this is a duplicate of 🐛 CKEditor 5: scroll jump after dialog close Active . But this now has a patch (thanks @gouthamraon!). But that issue is more general: it reports a similar problem with all dialogs. (The GIF there demonstrates this problem using the https://www.drupal.org/project/ckeditor_templates → contrib module.)
I think the patch in #5 also has an impact when using the media library dialog in non-CKEditor 5 contexts 😅 So I think right now this is fixing one problem and introducing another.
Or … is this actually fixing a bug elsewhere in core too?
IOW: we need to test the #5 patch when using a media field.
Conclusion:
- either this should be marked as a duplicate of 🐛 CKEditor 5: scroll jump after dialog close Active , because we should not change the media library dialog
- or this is the correct fix, and it improves the media library dialog's accessibility in non-CKEditor 5 contexts too, and
🐛
CKEditor 5: scroll jump after dialog close
Active
is really just reporting a bug in the
ckeditor_templates
module
Manual testing will tell! 😊
- 🇮🇳India gouthamraon
@wim-leers :I have verified the #5 patch with the media field and it's working fine.
- 🇺🇸United States edwardsay
Unfortunately, patch #5 does not work for me. It affects the "Insert selected" button, but not the close X button of the dialog itself. So when I close dialog the page jumps to the top of the CKE5 editor.
The JS solution from https://www.drupal.org/project/drupal/issues/3410598 🐛 CKEditor 5: scroll jump after dialog close Active works for drupalMedia CKE plugin too, though.
- 🇺🇦Ukraine vselivanov Kyiv, Ukraine
I had exactly the same issue with scroll and patch #5 fixed it.
Thank you, @gouthamraon! - 🇺🇸United States anand.panure
We are facing the same issue with drupal 10.2.3 and CKEditor5, the focus moves to the bottom of the page after adding a media inside the CkEditor and also attaching an image from the Imagery tab for my banner.
The patch #5, is helpful but it shifts your focus to the "Insert Media" button. So, if it's a large page and you use sticky toolbar of CKEditor, the focus moves to the toolbar (which you can say is to the top of the page.)
Thanks,
Anand Panure - 🇨🇦Canada francismak
Hi,
We are having the same issue, and the patch #5 is working, thx @gouthamraon.
The "jumping/scrolling" was caused by trying to get the parent element of the dialog.
L1126 of core/misc/ajax.jsOriginal issue:
Focus state bug on text field AJAX calls 🐛 Focus state bug on text field AJAX calls FixedIt introduced a new thing "preCommandsFocusedElementSelector". So if refocus back to "Insert Media" button is a problem as mentioned in #11, maybe able to make sure of this new command.
Ideally, it should focus the newly created media inside the CKEditor. However, the element doesn't exist before clicking the button.
And there is nothing to focus if user click 'x' to close the dialog in 3410598 🐛 CKEditor 5: scroll jump after dialog close ActiveInstead of focus, I wonder if there is a way to "do nothing".
- 🇫🇷France kumkum29
As @anand.panure says, we are facing the same issue on D9.5.11 + ckeditor5. I need to update Drupal to 10.2, but I need to resolve this issue before that.
Is there a quick fix to resolve this problem and keep the position of the inserted media ?
The mentionned fix in #5 already exists in the media_library of core (in D9.5.11).
Thanks.