Drupal.behaviors.xbDisableLinks doesn't disable links added to the DOM later

Created on 9 July 2025, 18 days ago

Overview

When you click "Preview" in XB, you can see a preview of the page you're building, without the XB sidebars and canvas overlay, so you can click on the page's interactive elements. However, we disable clicking links to navigate away from the page entirely. We do this with Drupal.behaviors.xbDisableLinks.

However, Drupal behaviors only run after the page is initially loaded, and after Drupal AJAX operations complete. Drupal behaviors don't run when, for example, React components that are on the page re-render in response to a state change, such as when using the Navigation component in πŸ“Œ Build a navigation code component Active .

Proposed resolution

Change xbDisableLinks from a Drupal behavior to a mutation observer (or any other technique for monitoring links that get added to the DOM). Or, keep the Drupal behavior but also add a mutation observer for catching subsequent links added outside of Drupal's AJAX operations.

User interface changes

πŸ› Bug report
Status

Active

Version

0.0

Component

Page builder

Created by

πŸ‡ΊπŸ‡ΈUnited States effulgentsia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024