Needs work
Project:
Drupal core
Version:
main
Component:
javascript
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 Aug 2025 at 11:19 UTC
Updated:
21 Jul 2026 at 07:25 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
jesus_md commentedI have created a path with the proposed solution I mentioned, on our projects solve this error.
Comment #3
jesus_md commentedComment #4
jesus_md commentedComment #5
jesus_md commentedComment #6
jesus_md commentedComment #7
jesus_md commentedComment #8
jesus_md commentedI found another issue with the same problem https://www.drupal.org/project/drupal/issues/3308432#comment-16139164
Comment #9
norman.lolThis here is a follow up of that other issue.
Comment #10
norman.lolRe-uploading the patch from #3308432-42: The link on the Image tag is redirecting to an undefined page from the node preview screen that fixes this issue. Credit needs to be given to @keshavv.
Comment #12
norman.lolHmmm, okay, just noticed now that #10 is just reverting what was done in #3308432: The link on the Image tag is redirecting to an undefined page from the node preview screen, so I guess this can't be the fix. Looks like we have to check both. Like this maybe:
Comment #13
norman.lolComment #14
smustgrave commentedFixes need to land in 11.x first as the development branch. Also fixes should be in MRs vs patches.
As a bug will also need test coverage too.
Thanks!
Comment #15
norman.lolMRs is nice yeah, got created already. But as long as GitLab doesn't offer a way to get static, non-changing patches, we still need that patch here.
Comment #17
norman.lolComment #18
smustgrave commentedFYI you had it right the first time. MR has to go to 11.x first. Then depending when it lands committer decides to backport to relevant branches.
Comment #19
norman.lolWould have needed a rebase first.
Comment #21
rmpereira commentedI had the issue on Drupal 11.2.4.
After applying the patch, I confirm that the problem is fixed.
Comment #23
julio_retkwaAdding patch to Drupal 11.3.3
Comment #25
scott_euser commentedI started to attempt to add test coverage for this, but I think issue summary steps to reproduce are inaccurate. At least for me with Gin & Navigation, if I click 'Content' (or any Navigation link) since they are outside the preview area, the JS the triggers the Leave Preview process. Reproducing that in the tests, its successful even without the JS change, whereas in my site, the JS change is needed.
So functionality-wise RTBC +1 from me BUT still needs work as this test coverage passes even without the change as is.
Comment #26
scott_euser commentedHopefully at least the test coverage gets someone going once issue summary is updated with clearer steps.
Comment #27
dennis_meuwissen commentedWe ran into this issue as well, in our case the detected href was not correct because the event target was an img tag inside an a tag:
event.targetandevent.currentTargetalways pointed to the img tag. What we ended up doing was getting the href fromthisbefore the dialog is built.