Skip to content

Repeater items get different markup structure when AJAX-loaded #1884

@Toutouwai

Description

@Toutouwai

Short description of the issue

The repeater inputfield uses an inconsistent markup structure and it seems to depend on whether an existing repeater item is AJAX-loaded or not.

In the examples below I have a simple repeater setup that only contains a single text field in the repeater template.

When a repeater item is not AJAX-loaded then the markup structure is as below. Items are not AJAX-loaded depending on several different field settings such as "Repeater item visibility in editor", "Repeater dynamic loading (AJAX) in editor" and "Remember which repeater items are open?". The structure below also applies to any new repeater items that have just been added.

2024-02-21_165716

But when a repeater item is AJAX-loaded then the markup structure is as below. Note the missing InputfieldWrapper around the field that belongs to the repeater template.

2024-02-21_165637

This inconsistency makes it difficult to reliably target elements within the repeater inputfield with JavaScript and CSS.

Expected behavior

The same markup structure regardless of whether a repeater item is AJAX-loaded or not. Different classes or attributes are fine - I mean the basic markup hierarchy so that which elements are siblings or parents to other elements is consistent.

Setup/Environment

  • ProcessWire version: 3.0.236

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions