Skip to content

Placeholder changes to input value in readonly input.#34040

Merged
mdo merged 8 commits into
twbs:mainfrom
rajesh2kumar96:readonly-input
Jun 3, 2021
Merged

Placeholder changes to input value in readonly input.#34040
mdo merged 8 commits into
twbs:mainfrom
rajesh2kumar96:readonly-input

Conversation

@rajesh2kumar96
Copy link
Copy Markdown
Contributor

@rajesh2kumar96 rajesh2kumar96 commented May 20, 2021

Fixes #34017

@ffoodd
Copy link
Copy Markdown
Contributor

ffoodd commented May 20, 2021

Thanks! Could you check there're no other occurrencies of such readonly inputs missing a value, either in the docs or the examples, please? If not, we'll take care of it 🙂

@coliff
Copy link
Copy Markdown
Contributor

coliff commented May 20, 2021

@ffoodd - yes, I think changes to the CSS are needed too. If you change the placeholder to a value then the displayed 'Readonly input here...' text is not the lighter grey as the Disabled inputs above.

Screenshot here by changing the HTML elements in Dev Tools (Edge 90 for Windows):
image

@ffoodd
Copy link
Copy Markdown
Contributor

ffoodd commented May 26, 2021

@coliff AFAIC that's acceptable since:

  • readonly is meant to be read, so better contrast are fine,
  • readonly and disabled aren't the same, so this helps reduce the confusion IMHO.
    However that's more of a UX decision. Maybe some accessibility insights too, @patrickhlauke?

@rajesh2kumar96 Were you able to check if there were other readonly inputs missing a value, both in our docs and in examples? If you can't, I'll try to.

@patrickhlauke
Copy link
Copy Markdown
Member

going purely by WCAG, nominally disabled fields / controls are exempted from 4.5:1 (regular) / 3:1 (large) contrast requirements. readonly fields aren't. even for disabled fields, a ratio of at least 3:1 or better is still best practice, the closer it can get to 4.5:1, the better. beyond that, it's down to aesthetic choices.

@rajesh2kumar96
Copy link
Copy Markdown
Contributor Author

@coliff AFAIC that's acceptable since:

  • readonly is meant to be read, so better contrast are fine,
  • readonly and disabled aren't the same, so this helps reduce the confusion IMHO.
    However that's more of a UX decision. Maybe some accessibility insights too, @patrickhlauke?

@rajesh2kumar96 Were you able to check if there were other readonly inputs missing a value, both in our docs and in examples? If you can't, I'll try to.

I will do this.

Comment thread site/content/docs/5.0/forms/form-control.md Outdated
@rajesh2kumar96
Copy link
Copy Markdown
Contributor Author

@ffoodd I changed readonly inputs with value. Please check.

Comment thread site/content/docs/5.0/forms/form-control.md Outdated
@mdo mdo merged commit 071a288 into twbs:main Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: Readonly input example should have a value

5 participants