Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the styling of read-only inputs #1106

Open
jamesjacobs opened this issue Jan 8, 2020 · 2 comments
Open

Improve the styling of read-only inputs #1106

jamesjacobs opened this issue Jan 8, 2020 · 2 comments

Comments

@jamesjacobs
Copy link
Collaborator

Currently, inputs with the readonly property/attribute are styled the same as disabled inputs which leads to user confusion. Investigate alternative styling.

Initial thoughts:

For consistency it might be better to stick to general input styling plus a visual indicator to denote read only.

Alternatively they could be styled as plain text, similar to how form.content appears but the markup should still be a form element (read-only inputs get submitted with form data and SRs will potentially skip plain text mixed in with form elements whilst in "forms mode". Read-only inputs can still gain focus so styling needs to accommodate that. Also need to allow for the potential of appended / prepended buttons and icons.

Needs more research and testing.

@Stanton
Copy link
Member

Stanton commented Aug 25, 2022

Screenshot 2022-08-25 at 17 00 06

🤷‍♂️

@jamesjacobs
Copy link
Collaborator Author

👍 Looks good to me. I've been back and forth a little bit on the border contrast but as text will always be present the border isn't the only visual indication of the hit area then it meets 1.4.11 Non-text contrast (see example under boundaries).

An alternative would be having just a bottom border or no border at all, but I prefer the dotted line.

2 questions:

  • How does it look with appended/prepended icons/text? We have an appended "Copy" button in a few places across product.
  • Re focus styling, we need to make sure it's a solid border on focus and not dotted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants