LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-ada
createdAtNov 18, 2026, 7:31 PM
updatedAtNov 18, 2026, 8:31 PM
githubUrlhttps://github.com/neomjs/neo/issues/21389
authorneo-opus-ada
commentsCount0
parentIssue21329
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 18, 2026, 8:31 PM

A left-labelled field squeezes its input to show an error

neo-opus-ada
neo-opus-ada commented on Nov 18, 2026, 7:31 PM

Sub of #21329. Owned by @neo-opus-ada for the Engine 14 cut (Mon 23 Nov), so no curated labels: #21376's field workbenches show an invalid state for every field type, so every left-labelled stage shows this.

Context

Measured on dev fe695ca1cf in devmode, examples/form/field/text, with the live field set through Neo.worker.App.setConfigs to showCharacterCount: false, labelPosition: 'left', labelWidth: 120, width: 360:

State Field display Input Error
no error flex, 27 px high 216 px wide none
error: 'Min length violation: 2 / 3' flex, 27 px high 92 px wide beside the input, same row (x 373–497)

With a character count the same field already shows the error on a row of its own. The earlier sighting: defect-note b00ffbbe (18 Nov 14:02Z, examples/form/field/email at 200 px: a 50 px input beside "Not a valid email address"). #21324 and #21329 left it out of scope as a layout decision for every text field. This ticket takes that decision.

The Problem

Neo.form.field.Text lays out as one flex row, [label][input][error wrapper], with a fixed height. An in-flow error becomes a third item in that row and takes its width from the input, down to the input's 50 px min-width. The field the user is correcting shrinks at the moment they need it.

The Architectural Reality

  • resources/css/src/form/field/Text.css: .neo-textfield is display: flex with height: calc(var(--textfield-input-height) + var(--textfield-border-width) * 2). &.neo-has-character-count switches to a grid, "label input" ". counter" ". error", with variants for right, top, bottom and inline labels and height: max-content.
  • src/form/field/Text.mjs: the error wrapper is in the DOM only while an error shows (errorWrapper.removeDom = !value). errorPositionAbsolute adds .neo-absolute to .neo-textfield-error, which takes it out of the flow.
  • resources/css/src/form/field/TextArea.css adjusts the textarea under :has(.neo-textfield-error); resources/css/src/form/field/Chip.css gives the inline-labelled chip field a grid of its own with an error row.

Design authority: PR #20311 (#3935) — the character-count grid puts the error on its own row under the input column, for every label position. No record keeps the in-row error for a field without a counter; #21324 deferred the choice.

The Fix

In resources/css/src/form/field/Text.css, a field showing an in-flow error takes the same grid as a field with a counter: the grid rule's selector becomes &.neo-has-character-count, &:has(> .neo-textfield-error-wrapper > .neo-textfield-error:not(.neo-absolute)). No JavaScript changes: the DOM already says whether an in-flow error shows.

Acceptance Criteria

  • AC-1: A left- or right-labelled field showing an in-flow error keeps its input's width, and the error sits below the input, starting at the input's left edge.
  • AC-2: Top, bottom and inline labels keep their error below the input, as today.
  • AC-3: A field with errorPositionAbsolute keeps its absolute error and its one-row height.
  • AC-4: A field without an error renders as before.
  • AC-5: A browser spec reads the input's width and the error's position with and without an error: red on dev, green at head.
  • AC-6: Post-merge: the invalid cells of the field workbenches show the error under the input (the tile pass with #21333).

Out of Scope

  • Error wording and colours.
  • The chip field's inline grid (Chip.css), which already has its error row.

Avoided Traps

  • Keying the layout on .neo-invalid: a field can be invalid without a visible error (before its first validation), and the layout would jump with no message to show.
  • A JavaScript class toggle for the same fact the DOM already carries.

Related

Live latest-open + closed sweep: checked latest 20 open plus open and closed search ("field error layout", "error message shrinks input", "textfield error position label", "error message below input"; #3935 and #21324 read on their error clauses) at 2026-11-18T18:30Z; no equivalent or prior exclusion beyond #21324's deferral. Backlog: 85 open (red), folded under #21329. A2A in-flight claim sweep: last 30 messages, no claim on the text field's error layout. MC sweep: "an invalid field with a left label shows its error message beside the input and shrinks the input" plus a message search; my defect-note b00ffbbe and a 5 Nov note on #3935's error row; no prior decision. Own-assignment sweep: 10 open; #21329 is the parent, none overlapping.

Retrieval Hint: "left label error message shrinks the input text field grid"