Repository navigation
fix(ui-text-input,ui-file-drop,ui-number-input): small visual error state fixes - #2825
Conversation
|
Visual regression reportCypress suite: ✅ Passing Visual diff:
Accessibility (axe): ✅ No violations. 📊 View full report — click a screenshot's ⚠ badge to see each violation boxed on the image, with the offending element named and contrast failures shown as color swatches. Diff images (9)filedrop-canvas.png — 5533 pixels differfiledrop-dark.png — 6032 pixels differfiledrop-light.png — 6008 pixels differform-errors-canvas.png — 1046 pixels differform-errors-dark.png — 557 pixels differform-errors-light.png — 558 pixels differselect-canvas.png — 1896 pixels differselect-dark.png — 1794 pixels differselect-light.png — 1792 pixels differBaselines come from the |
| params: StyleParams, | ||
| _sharedTokens: SharedTokens | ||
| props: FileDropProps, | ||
| _sharedTokens: SharedTokens, | ||
| state: FileDropStyleProps | ||
| ): FileDropStyle => { | ||
| const { | ||
| height, | ||
| functionallyDisabled, | ||
| visuallyDisabled, | ||
| dragRejected, | ||
| dragAccepted | ||
| } = params |
There was a problem hiding this comment.
this component was buggy, tried to read state from props
0dbfc96 to
bda326f
Compare
balzss
left a comment
There was a problem hiding this comment.
Some of the prop combinations seem to work incorrectly:
1. Readonly success border
<TextInput
renderLabel="Username"
interaction="readonly"
forceMessages
messages={[{ type: 'success', text: 'Username is available' }]}
/>Expected: a green border, the same as an enabled input with a success message.
Actual: the success message shows, but the border stays the gray readonly color.
2. Readonly focus ring and aria-invalid
<TextInput
renderLabel="Email"
interaction="readonly"
messages={[{ type: 'error', text: 'Enter a valid email' }]}
/>Tab into the field.
Expected: the message is hidden, so no error state: a normal focus ring and no aria-invalid.
Actual: no message and a gray border, but the focus ring is red and the input has aria-invalid="true", so screen readers announce "invalid" with nothing explaining why.
3. Where case 2 happens in real code
<TextInput
renderLabel="Email"
interaction={isEditing ? 'enabled' : 'readonly'}
messages={errors.email}
/>A form with a view mode. If errors.email still holds an error when the form switches to view mode, the field ends up in the half-invalid state from case 2.
d87e139 to
518e747
Compare
|
@balzss I could not repro case 1. I could repro case 2, its fixed now |
in readonly+success mode the border is grey. in normal success mode the border is green |
…ssages A Select without onInputChange, and so every SimpleSelect, renders its TextInput as readonly with forceMessages. The error border color was only applied for interaction "enabled", so these fields showed the error message but kept a gray border. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
withStyleNew passes component state to generateStyle as the fourth argument, but FileDrop v2 read it from the props argument. dragRejected, dragAccepted and the disabled flags were always undefined, so the error border never rendered. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
TextInput already switches its focus ring to danger or success. NumberInput did not pass a focusColor, so the ring stayed blue in the error state. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
518e747 to
d19941d
Compare
…tate fixes (#2825) ## Summary - `Select` and `SimpleSelect` shows now red error border all the time there is an error. - `FileDrop` shows now red error border in error state. - `NumberInput`: shows now red error focus ring in error state. ## Test Plan - Open the Error messages example in `docs/guides/forms.md` and check that SimpleSelect, FileDrop and NumberInput show the red border or focus ring, including in dark mode. - Drag a file over a FileDrop and check the accepted and rejected borders. Check a disabled FileDrop looks dimmed. Fixes INSTUI-5276 🤖 Generated with [Claude Code](https://claude.com/claude-code)











Summary
SelectandSimpleSelectshows now red error border all the time there is an error.FileDropshows now red error border in error state.NumberInput: shows now red error focus ring in error state.Test Plan
docs/guides/forms.mdand check that SimpleSelect, FileDrop and NumberInput show the red border or focus ring, including in dark mode.Fixes INSTUI-5276
🤖 Generated with Claude Code