Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Repeatable set label acting as add button
- Attribute filtering not clearing selected autocomplete value when invalid

## [10.0.0] - 2026-03-31
Expand Down
26 changes: 17 additions & 9 deletions src/components/renderer/FormElementLabelContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,35 @@ function FormElementLabelContainer({
required,
children,
leading,
associateLabelWithInput = true,
}: {
className: string
element: FormTypes.FormElementBase
id: string
required: boolean
children: React.ReactNode
leading?: React.ReactNode
/** When false, render the title as a span (no htmlFor), e.g. repeatable sets with no single control. */
associateLabelWithInput?: boolean
}) {
const labelId = `${id}-label`
const labelClassName = clsx('ob-label', {
'ob-label__required is-required': required,
})

return (
<div className={clsx('ob-form__element', className)}>
<div className="label ob-label__container">
{leading}
<label
className={clsx('ob-label', {
'ob-label__required is-required': required,
})}
htmlFor={id}
id={`${id}-label`}
>
{element.label}
</label>
{associateLabelWithInput ? (
<label className={labelClassName} htmlFor={id} id={labelId}>
{element.label}
</label>
) : (
<span className={labelClassName} id={labelId}>
{element.label}
</span>
)}
{element.hint &&
(element.hintPosition === 'TOOLTIP' || !element.hintPosition) && (
<HintTooltip hint={element.hint} inputId={id} />
Expand Down
3 changes: 1 addition & 2 deletions src/form-elements/FormElementRepeatableSet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -401,12 +401,12 @@ function FormElementRepeatableSet({
element={element}
id={id}
required={!!minSetEntries && minSetEntries > 0}
associateLabelWithInput={false}
>
{element.layout === 'MULTIPLE_ADD_BUTTONS' && showAddButton && (
<AddButton
onAdd={() => handleAddEntry(0)}
element={element}
id={id}
classes={['ob-button-repeatable-set-layout__multiple-add-buttons']}
/>
)}
Expand Down Expand Up @@ -445,7 +445,6 @@ function FormElementRepeatableSet({
<AddButton
onAdd={() => handleAddEntry(entries.length)}
element={element}
id={id}
/>
)}
{(isDirty || displayValidationMessage) &&
Expand Down
Loading