Story 2466: Update global Text Field component with disabled state#2495
Story 2466: Update global Text Field component with disabled state#2495javiercoronadonarvaez wants to merge 2 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe disabled state of the text field component is updated in two files: the CSS replaces the opacity-based approach with explicit background, border, text, and icon color rules for ChangesDisabled Text Field State
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
78b692d to
0ffa510
Compare
jlchilders11
left a comment
There was a problem hiding this comment.
Thanks for the work, looks good to me!
For an example/place to check that this style is correct, the edit user UI (found at /users/me/?edit=True) uses this styling for the email field.
julhoang
left a comment
There was a problem hiding this comment.
Hi @javiercoronadonarvaez , I have an additional request please! 🙏
For the ease of testing, would you mind adding a disabled field to the V3 Demo page (URL: http://localhost:8000/v3/demo/components/#form-inputs, component: _v3_example_section.html)?
| background-color: var(--color-surface-mid, #f7f7f8); | ||
| border-color: var(--color-stroke-strong, #05081640); | ||
| cursor: not-allowed; | ||
| } | ||
|
|
||
| .field__control--disabled .field__input, | ||
| .field__control--disabled .field__input::placeholder, | ||
| .field__control--disabled:hover .field__input::placeholder { | ||
| color: var(--color-text-secondary, #6b6d78); | ||
| } | ||
|
|
||
| .field__control--disabled .field__input { | ||
| cursor: not-allowed; | ||
| } | ||
|
|
||
| .field__control--disabled .field__icon, | ||
| .field__control--disabled:hover .field__icon, | ||
| .field__control--disabled:focus-within .field__icon { | ||
| color: var(--color-icon-secondary, #6b6d78); | ||
| } | ||
|
|
There was a problem hiding this comment.
Would you mind removing the CSS fallback HEX values? In our project, we prefer not to provide those fallback values so that we can more easily spot if a token was not defined/set properly!
0ffa510 to
b43c4b7
Compare
|
Once again, thanks for your observations. All addressed and ready for review. |
5deb33c to
a08c0cb
Compare
herzog0
left a comment
There was a problem hiding this comment.
Looking good! Thanks @javiercoronadonarvaez
julhoang
left a comment
There was a problem hiding this comment.
Looks great to me ✨, thanks Javier!
Issue: #2466
Summary & Context
Updates the global Text Field component's disabled state to match the Figma UI Kit. The disabled styling now uses a gray surface + stronger border + muted text/icon with a lock icon in the trailing slot, replacing the previous
opacity: 0.5dim and bringing the shared component to parity with the search bar's no-JS (disabled) state.localhost:8000/v3/field-demo/. Please refer to the Screenshots section for more details.Changes
static/css/v3/forms.css(.field__control--disabled): swappedopacity: 0.5forbackground-color: --color-surface-mid,border-color: --color-stroke-strong, muted text/placeholder (--color-text-secondary) and icon (--color-icon-secondary), including hover/focus overrides so a disabled field no longer reacts to hover.templates/v3/includes/_field_text.htmlto render alockicon in the trailing slot whendisabled, taking priority over bothsubmit_iconandicon_right.Please list any potential risks or areas that need extra attention during review/testing
disabled=Trueinto_field_text.html, so this defines correct behavior going forward rather than altering an existing screen. Low regression risk._field_datetime.htmlreuses.field__control--disabled, so it automatically picks up the new gray styling. It keeps its own calendar affordance (no lock icon); this is consistent, not a regression.--color-surface-mid,--color-stroke-strong,--color-text-secondary,--color-icon-secondary) with the repo's standard hex fallbacks. No new hardcoded values.Screenshots
GlobalTextField.mov
Self-review Checklist
Frontend
Summary by CodeRabbit
not-allowedcursor behavior across base, hover, and focus-within states.