Skip to content

Conversation

@mjauvin
Copy link
Member

@mjauvin mjauvin commented Jan 23, 2026

Allow any input element as titleFrom, leave responsibility to user not to choose a type that doesn't make sense (e.g. button)

Summary by CodeRabbit

  • Bug Fixes
    • Repeater widget more reliably derives collapse titles from a broader set of form elements (no longer limited to plain text inputs), improving display consistency.
    • Enhanced fallback logic when a collapse title isn’t found, so items show meaningful labels more often across varied input types.

✏️ Tip: You can customize this high-level summary in your review settings.

@mjauvin mjauvin added this to the 1.2.10 milestone Jan 23, 2026
@mjauvin mjauvin requested a review from LukeTowers January 23, 2026 20:34
@mjauvin mjauvin self-assigned this Jan 23, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

Walkthrough

Introduce a dynamic selector in the repeater widget's getCollapseTitle so the title source prefers a computed target input (including non-text inputs when titleFrom points to a target) and falls back to select/ul or the item itself when no valid target exists.

Changes

Cohort / File(s) Summary
Repeater Widget Selector Update
modules/backend/formwidgets/repeater/assets/js/repeater.js
getCollapseTitle now initializes a selector variable and uses $(selector, $target).first() to choose the collapse-title source. When titleFrom matches a target, the selector expands to include non-text input types; otherwise it falls back to select/ul elements or the item itself.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly reflects the main change: removing the input type=text requirement for the Repeater titleFrom feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

@mjauvin mjauvin changed the title Remove input type text requirement Remove Repeater titleFrom input type text requirement. Jan 23, 2026
@mjauvin mjauvin changed the title Remove Repeater titleFrom input type text requirement. Remove Repeater titleFrom input type=text requirement. Jan 23, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@modules/backend/formwidgets/repeater/assets/js/repeater.js`:
- Around line 324-334: The code reads $target.length without ensuring $target is
defined when this.options.titleFrom is falsy; initialize or guard $target so
collapse handlers don't throw. Modify the block around this.options.titleFrom
and $target (the variables $target, selector, $item, and the subsequent
$textInput lookup) so that $target is set to $item by default (or check that
$target is truthy before accessing .length) before using it to find the selector
and creating $textInput.

@LukeTowers LukeTowers merged commit 04ff870 into develop Jan 24, 2026
14 checks passed
@LukeTowers LukeTowers deleted the title-from-input branch January 24, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants