Skip to content

fix(ui-checkbox,ui-form-field): change the required asterisk to always red - #2834

Open
matyasf wants to merge 2 commits into
masterfrom
fix/required-asterisk-color
Open

matyasf wants to merge 2 commits into
masterfrom
fix/required-asterisk-color

Conversation

@matyasf

@matyasf matyasf commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • FormFieldLayout (v2) always applies formFieldLayout/asteriskColor to the required asterisk, so inputs like TextInput no longer change its color on error.
  • Checkbox (v2) does the same with checkbox/asteriskColor; the internal style key requiredInvalid becomes requiredAsterisk. Checkbox needs to be handled separately because it does not use FormField
  • the forms example https://instructure.design/pr-preview/pr-2834/#forms can be seen now with the dark theme

Test Plan

  • Put a required TextInput and a required Checkbox into an error state and check the asterisk keeps the same color as the valid state.
  • In the light/dark themes the asterisk is always red (text.error). In the legacy canvas themes FormFieldLayout uses the label color, but Checkbox is always red (checkbox/asteriskColor is text.error there). Check whether that mismatch is acceptable.

Fixes INSTUI-5278

🤖 Generated with Claude Code

@matyasf matyasf self-assigned this Dec 1, 2026
@matyasf
matyasf added this pull request to stack #2835 December 1, 2026 11:49
@matyasf matyasf changed the title fix(ui-checkbox,ui-form-field): keep the required asterisk color in error state fix(ui-checkbox,ui-form-field): the required asterisk is always red Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.2

QR code for preview link

🚀 View preview at
https://instructure.design/pr-preview/pr-2834/

Built to branch gh-pages at 2026-12-03 12:28 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@matyasf
matyasf force-pushed the fix/required-asterisk-color branch from 09d83b7 to 29a38c7 Compare December 1, 2026 11:56
@matyasf matyasf changed the title fix(ui-checkbox,ui-form-field): the required asterisk is always red fix(ui-checkbox,ui-form-field): change the required asterisk to always red Dec 1, 2026
github-actions Bot pushed a commit that referenced this pull request Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Visual regression report

Cypress suite: ✅ Passing

Visual diff: ⚠️ Changes detected.

Status Count
Unchanged 108
Changed 3
New 0
Removed 0

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 (3)

datetimeinput-dark.png — 19 pixels differ

datetimeinput-light.png — 19 pixels differ

tooltip-light.png — 15266 pixels differ

Baselines come from the visual-baselines branch. They refresh on every merge to master. The Cypress suite line covers the a11y and console-error assertions — a ❌ there means the suite found real issues even if the visual diff is clean.

github-actions Bot pushed a commit that referenced this pull request Dec 1, 2026

@HerrTopi HerrTopi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See my one comment

Comment thread docs/guides/forms.md

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This file references "this was made for v11_7, if viewing on a different version, stop" or along these lines.
I don't think it makes sense. It is always displayed in v11.7 and there is no way of changing that. I know it's a legacy bug, but we should fix this before putting the spotlight on this doc page with this change

image image

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I've removed the second error message

@matyasf
matyasf force-pushed the fix/required-asterisk-color branch from 6a73ad6 to de17104 Compare December 3, 2026 12:16
Base automatically changed from fix/error-state-visuals to master December 3, 2026 12:17
…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)
@matyasf
matyasf force-pushed the fix/required-asterisk-color branch from de17104 to 37a4518 Compare December 3, 2026 12:17
github-actions Bot pushed a commit that referenced this pull request Dec 3, 2026
…rror state

The asterisk only received its themed color when the field was invalid, so it changed color on
error even though an error can have causes other than a missing required value. It now always
uses the component's asteriskColor token.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@matyasf
matyasf force-pushed the fix/required-asterisk-color branch from 37a4518 to 1ab7056 Compare December 3, 2026 12:25
@matyasf
matyasf requested a review from HerrTopi December 3, 2026 12:27
github-actions Bot pushed a commit that referenced this pull request Dec 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants