Skip to content

Form: fields should not exceed group column width when many items are selected (T1326645)#33268

Open
pharret31 wants to merge 3 commits intoDevExpress:26_1from
pharret31:26_1_3925-form-tagbox-exceeds-the-group-column-when-the-selected-tag-items-exceed-the-field-container-t1326645
Open

Form: fields should not exceed group column width when many items are selected (T1326645)#33268
pharret31 wants to merge 3 commits intoDevExpress:26_1from
pharret31:26_1_3925-form-tagbox-exceeds-the-group-column-when-the-selected-tag-items-exceed-the-field-container-t1326645

Conversation

@pharret31
Copy link
Copy Markdown
Contributor

No description provided.

@pharret31 pharret31 self-assigned this Apr 14, 2026
@pharret31 pharret31 requested a review from a team as a code owner April 14, 2026 17:34
Copilot AI review requested due to automatic review settings April 14, 2026 17:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a regression fix for Form layout so editor content (notably TagBox with many selected items) can shrink within a group column instead of overflowing.

Changes:

  • Adjusted Form CSS to allow field content to shrink (min-width: 0) in left/right label layouts.
  • Added a QUnit regression test covering TagBox width behavior in a grouped Form (T1326645).
  • Cleaned up several test titles/assertion messages for clarity.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
packages/devextreme/testing/tests/DevExpress.ui.widgets.form/form.markup.tests.js Adds TagBox regression test and updates wording; includes theme + TagBox imports needed for the scenario.
packages/devextreme-scss/scss/widgets/base/_form.scss Adds min-width: 0 to help field item content shrink instead of overflowing its column.

Comment on lines +829 to +835
const $label = $group.find(`.${FIELD_ITEM_LABEL_CLASS}`).first();
const $content = $group.find(`.${FIELD_ITEM_CONTENT_CLASS}`).first();

const groupWidth = $group.outerWidth();
const totalItemWidth = $label.outerWidth() + $content.outerWidth();

assert.strictEqual(totalItemWidth <= groupWidth, true, `field item content width (${totalItemWidth}) should not exceed group width (${groupWidth})`);
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

This width assertion may be flaky: summing outerWidth() of the label and content can differ from the actual rendered field width due to rounding and box model differences across browsers/themes. Consider comparing element bounding rectangles (e.g., right edge of the field item/content vs right edge of the group) and/or allowing a small tolerance (1–2px).

Suggested change
const $label = $group.find(`.${FIELD_ITEM_LABEL_CLASS}`).first();
const $content = $group.find(`.${FIELD_ITEM_CONTENT_CLASS}`).first();
const groupWidth = $group.outerWidth();
const totalItemWidth = $label.outerWidth() + $content.outerWidth();
assert.strictEqual(totalItemWidth <= groupWidth, true, `field item content width (${totalItemWidth}) should not exceed group width (${groupWidth})`);
const $content = $group.find(`.${FIELD_ITEM_CONTENT_CLASS}`).first();
const groupRect = $group.get(0).getBoundingClientRect();
const contentRect = $content.get(0).getBoundingClientRect();
const widthTolerance = 2;
assert.ok(
contentRect.right <= groupRect.right + widthTolerance,
`field item content right edge (${contentRect.right}) should not exceed group right edge (${groupRect.right}) with tolerance ${widthTolerance}px`,
);

Copilot uses AI. Check for mistakes.
Comment on lines 80 to +82
.dx-field-item-content {
vertical-align: top;
min-width: 0;
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

min-width: 0 is added only for .dx-field-item-content, but in .dx-flex-layout both .dx-field-item-content and .dx-field-item-content-wrapper are configured as flex items (flex-shrink/grow/basis). If a field uses the wrapper (e.g., when helpText is rendered), the wrapper can still be prevented from shrinking by the default min-width: auto. Consider applying min-width: 0 to the wrapper as well (or scoping the rule specifically to the flex layout selectors).

Suggested change
.dx-field-item-content {
vertical-align: top;
min-width: 0;
.dx-field-item-content,
.dx-field-item-content-wrapper {
min-width: 0;
}
.dx-field-item-content {
vertical-align: top;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants