-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
Read-only text block for forms #13644
Comments
Ping |
I'm not sure if I get this right: Or you want to "display anything you want" but styled as if it was a Material styled text field? |
@kirill-konshin What was #9790 (comment) lacking? Displaying an image in |
I was not talking about adornments, I was looking for something that allows to display any content with an input label on top. The implementation that I've supplied to this ticket does exactly this. |
But that's not really an input not even mentioning a textfield. It's just a generic container with a label. I was interested in a specific use case that relates to input provided by the user. |
Case 1. Read-only phrase with edit button |
Sounds like #9790 (comment) would solve this. What is missing?
That's very specific use case where an input is not the appropriate abstraction
This should be covered by https://material-ui.com/demos/selection-controls/#radio-buttons I feel like your example is perfectly fine. It's a generic container with a label. |
#9790 (comment) can only have text, no hyperlinks, no images, no custom tags, so this does not work. Fieldset+legend (https://material-ui.com/demos/selection-controls/#radio-buttons) could be an option as a generic container with a label, but it has different visual style than a textfield's label, that's my main concern... |
Actually, this issue is coupled with #13643, forgot to mention that ) |
Sorry for confusion. This particular ticket is only about the The container discussion is a separate ticket: #13643. |
This seems to be a duplicate of #9790. The readOnly prop is supposed to cover this problem. |
No, readOnly prop just makes field to become read only, it does not allow to have HTML markup in the block. I commented about that earlier in this thread:
|
Quite frequently there's a need to display some value in the form, it could be achieved by making an input read only (there was a proposal to add read-only prop for
TextField
: #9790), but it would still have the underline, also, the presented text can have formatting, links, images, etc., which is impossible to do withinput
.So far I used the following code as temp solution:
So that it could be used as follows:
Does it make sense to add such component to the lib? Is it safe to use default styles like this?
PS. There is a special class in bootstrap for such case: http://getbootstrap.com/docs/4.1/components/forms/#readonly-plain-text
The text was updated successfully, but these errors were encountered: