Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

---#34585

Locked
ardc-shorn announced inArchive
---#34585
Oct 3, 2022· 2 comments
Discussion options

How come discussions can only be polls? What am I doing wrong?

Anyway.

https://stackoverflow.com/questions/73930237/is-there-an-output-version-of-the-textfield-input

Using MUI v5.10.3

I need to display a few "output" fields, the user won't be editing the content of the field.

I like the way the MUI TextField looks, but it's meant as an input widget, which means it has a few downsides:

  • width is constant, doesn't expand with the content being displayed
  • reacts to user input, it has hover highlight and reacts to a click by highlighting the field
  • participates in focus traversal (i.e. "tabbing" through fields will highlight these output fields)

I've build my own component out of a fieldset element and a Typography component. But the styling leaves a lot to be desired - it looks wonky on desktop and even worse on mobile.

Is there an equivalent MUI component I can use, that looks similar to TextField but is meant for displaying data?

I've looked through the MUI component doco, but didn't see anything that seemed to fit.

You must be logged in to vote

Replies: 2 comments

Comment options

Would a read-only Text Input solve your use case?https://mui.com/material-ui/react-text-field/#form-props

You must be logged in to vote
0 replies
Comment options

I'm locking the conversation, this space is for polls. You can either open an issue if you believe it's a bug or a general discussion. You can also ask on StackOverflow. Thanks.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Archive
Labels
None yet
3 participants
@ardc-shorn@oliviertassinari@michaldudak

[8]ページ先頭

©2009-2025 Movatter.jp