fix: remove collapsible label prefix from the FieldSelect dropdown component (#10760)

### What?

Removes Collapsible label from child field label in the `FieldSelect`
component (for example Bulk Edit field select dropdown)

### Why?

Including the Collapsible field label in the option label of the
FieldSelect component could potentially be confusing to a user as it
eludes to the field being nested in the Data schema.

### How?

In the reduceFields function of the FieldsLabel component, if
`field.type === 'collpasible'` the collapsible field's label will not be
combined with the child fields labels.

Fixes #10757

---------

Co-authored-by: Patrik Kozak <patrik@payloadcms.com>
This commit is contained in:
Will Robson
2025-02-17 15:44:13 -05:00
committed by GitHub
parent 106d7dde23
commit a5e6ea5737
2 changed files with 17 additions and 0 deletions

View File

@@ -612,6 +612,20 @@ describe('fields', () => {
)
await expect(customCollapsibleLabel).toHaveCSS('text-transform', 'uppercase')
})
test('should not render collapsible label in bulk update field select', async () => {
await page.goto(url.list)
await page.locator('input#select-all').check()
await page.locator('.edit-many__toggle').click()
await page.locator('.field-select .rs__control').click()
const firstCollapsibleOption = page.locator('.rs__option', {
hasText: exactText('Text'),
})
await expect(firstCollapsibleOption).toBeVisible()
})
})
describe('blocks', () => {