Closed (duplicate)
Project:
Experience Builder
Version:
0.x-dev
Component:
Page builder
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Mar 2025 at 17:28 UTC
Updated:
28 Jul 2025 at 21:19 UTC
Jump to comment: Most recent

Comments
Comment #2
sea2709 commentedAssign this one to myself. I think the issue is the preview area is rendered by an iframe, and when users click on links in iframe, by default, it refreshes the page, I'm thinking about adding a base tag in the preview iframe will make the link to be opened on the parent window.
Comment #4
sea2709 commented@lauriii: When you have a chance, can you review my MR? I see that the cypress E2E job is fail because of 2 failed test cases in component-operations.cy.js. I don't know if it's an on-going issue or it's related to my changes.
Comment #5
wim leerse2e tests should be more reliable now. Queued a new run for you.
I'll let the lead for code components review this, thanks, @sea2709! 😄
Comment #6
wim leersNote that this is not the same as #3515615: Prevent navigation in code component editor preview:
Also: fixing the issue queue component; I was wrong in #5.
Comment #7
jessebaker commented@lauriii Do you think this is a speed/race condition situation? It seems like, in the gif, the issue occurs when quickly clicking the link immediately after refreshing the browser? Do you think that's the reason why it's only happening "in some instances".
For clarity the way the link interception works is that there is a drupal behaviour loaded in the page when it's in the preview that preventsDefault on the click event and uses a postmessage to communicate up to the parent of the iFrame (our React app).
My suspicion is that some kind of race condition either means you are able to click the link before the event handler has been bound to the link OR the event handler is not getting bound to the link as a result of it running before the link is rendered on the page (by Astro).
Comment #8
jessebaker commentedMarking as postponed pending a bit more info as I am unable to reproduce.
Comment #9
wim leers#3515615: Prevent navigation in code component editor preview just landed btw, so I want to emphasize how this is not that — see #6.
Comment #10
effulgentsia commentedClosing this as a duplicate of #3535072: Drupal.behaviors.xbDisableLinks doesn't disable links added to the DOM later.