fix(ui): blocks field not respecting width styles in row layouts (#13502)

### What?

This PR applies `mergeFieldStyles` to the `BlocksField` component,
ensuring that custom admin styles such as `width` are correctly
respected when Blocks fields are placed inside row layouts.

### Why?

Previously, Blocks fields did not inherit or apply their `admin.width`
(or other merged field styles). For example, when placing two Blocks
fields side by side inside a row with `width: '50%'`, the widths were
ignored, causing layout issues.

### How?

- Imported and used `mergeFieldStyles` within `BlocksField`.
- Applied the merged styles to the root `<div>` via the `style` prop,
consistent with how other field components (like `TextField`) handle
styles.

Fixes #13498
This commit is contained in:
Patrik
2025-08-18 12:15:40 -04:00
committed by GitHub
parent f9bbca8bfe
commit 30ea8e1bac
4 changed files with 121 additions and 0 deletions

View File

@@ -1129,6 +1129,22 @@ export interface RowField {
no_set_width_within_row_b?: string | null;
no_set_width_within_row_c?: string | null;
field_20_percent_width_within_row_d?: string | null;
leftColumn?:
| {
leftText?: string | null;
id?: string | null;
blockName?: string | null;
blockType: 'leftTextBlock';
}[]
| null;
rightColumn?:
| {
rightText?: string | null;
id?: string | null;
blockName?: string | null;
blockType: 'rightTextBlock';
}[]
| null;
updatedAt: string;
createdAt: string;
}
@@ -2760,6 +2776,28 @@ export interface RowFieldsSelect<T extends boolean = true> {
no_set_width_within_row_b?: T;
no_set_width_within_row_c?: T;
field_20_percent_width_within_row_d?: T;
leftColumn?:
| T
| {
leftTextBlock?:
| T
| {
leftText?: T;
id?: T;
blockName?: T;
};
};
rightColumn?:
| T
| {
rightTextBlock?:
| T
| {
rightText?: T;
id?: T;
blockName?: T;
};
};
updatedAt?: T;
createdAt?: T;
}