feat: subdue read-only field border and drop hover#1060
Draft
lmjabreu wants to merge 2 commits into
Draft
Conversation
Read-only TextField and TextArea reused the editable idle border and still brightened on hover and focus, which read as interactive on a field that is not. Read-only fields now use a subdued border (--reactist-divider-tertiary) and no longer react to hover. The focus border is kept, since read-only fields stay keyboard-focusable for reading and copying (WCAG 2.4.7). Applies to the read-only state regardless of readOnlyVariant (the variant only toggles the grey fill) and covers the default and bordered variants of both components. BaseField gains a readOnly prop so the bordered border, which it owns, can be gated. The fill class is split out as readOnlyFilled so the state and the fill are independent. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
|
@doistbot /review |
doistbot
reviewed
Jun 6, 2026
doistbot
left a comment
Member
There was a problem hiding this comment.
Thanks for refining the read-only visual behaviors and cleanly separating the state from the fill variant, Luis 🤗.
Few things worth tightening:
- Expand the tests for both
TextFieldandTextAreato include avariant="bordered"case, ensuring the outer containers correctly receive thereadOnlyclass rather than only checking the inner input elements.
I also included a few optional follow-up notes in the details below.
Optional follow-up notes (2)
- [P3] src/text-area/text-area.tsx:112: Since
BaseFieldreceivesreadOnlyon line 107 and natively handles the subdued border and hover gating for the.borderedwrapper (viabase-field.module.css), passingstyles.readOnlyhere is redundant. You can remove this line, and simplifytext-area.module.css(lines 54-60) to only target the:not(.bordered)variant, exactly liketext-fielddoes:css .textAreaContainer:not(.bordered) textarea.readOnly { border-color: var(--reactist-divider-tertiary); } .textAreaContainer:not(.bordered) textarea:not(.readOnly):hover { border-color: var(--reactist-inputs-hover); } - [P3] src/text-field/text-field.mdx:94: This new note now conflicts with the sentence just above it that says
readOnlyVariant="plain"makes the field look identical to its editable state. After this change, plain read-only fields still get the subdued border/no-hover treatment, so please update that earlier sentence here (and the matching copy intext-area.mdx) to keep the docs consistent.
3 tasks
…Area Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No linked issue. Follow-up to #1059, stacked on
feat/readonly-variant-fields(base of this PR). Review #1059 first; this targets that branch and will retargetmainonce #1059 merges.Short description
Read-only
TextFieldandTextAreareused the editable idle border and still brightened it on hover and focus. On a field you cannot edit, that hover/focus reaction reads as interactive. This refines the read-only treatment:--reactist-divider-tertiary(one step lighter than the editable idle border) so a locked field is visually quieter.This applies to the read-only state regardless of
readOnlyVariant; the variant only toggles the grey fill. It covers the default and theborderedvariant of both components.Implementation notes
readOnlyFilled, so the read-only state (subdued border, no hover) and the fill (grey background) are independent.plainread-only fields get the subdued border without the fill.BaseFieldgains areadOnlyprop. The bordered border is drawn byBaseField, so it needs the read-only signal to gate hover and apply the subdued color. The prop is optional and additive.!important, so a read-only field in an error state keeps its red border.Scope
This is intentionally separate from #1059. #1059 is purely additive (a new prop, no change to existing appearance). This PR changes the default read-only appearance of every field across the app, so it carries the visual diffs and is reviewed on its own.
PR Checklist