Override mode: Insert wrapped element after opening comment not before closing one

Created on 20 October 2023, over 1 year ago
Updated 6 November 2023, over 1 year ago

Problem/Motivation

Under certain circumstances, the current code in Drupal.behaviors.OverrideUiBehaviour.processHtmlComments() seems to twist the order of elements and cause a re-ordering, such that for example the title block is displayed at the end of the region instead of the beginning as expected.

Steps to reproduce

This seems to happen only under certain circumstances, which I'm unfortunately unable to identify at this point.

Proposed resolution

Currently, the identification of the template element in Drupal.behaviors.OverrideUiBehaviour.processHtmlComments() for cases with more than one element inside a comment creates a new <override-mode> which will contain the wrapped template elements. This new element is currently inserted before the closing comment which seems to cause this issue. Instead we can insert it after the opening comment, which seems to fix the issue.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024