-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[material-ui][Button] Add demo for file upload #38786
Conversation
Netlify deploy previewBundle size report |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good; thanks for contributing! 🤙
Left a suggestion that simplifies the demo code a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anle9650 Thanks, great demo!
@michaldudak Comparing https://mui.com/joy-ui/react-button/#file-upload to https://deploy-preview-38786--material-ui.netlify.app/material-ui/react-button/#file-upload is interesting. Joy UI button based on Base UI needs a role={null}
while Material UI doesn't. A bug in Base UI Button component?
const VisuallyHiddenInput = styled('input')` | ||
clip: rect(0 0 0 0); | ||
clip-path: inset(50%); | ||
height: 1px; | ||
overflow: hidden; | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
white-space: nowrap; | ||
width: 1px; | ||
`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know, the standard is for all the demos should use the JavaScript object syntax in Base UI, Joy UI,
Material UI. I imagine it's because 1. the source are written this way, so easier for developers to move between source and demos, and 2. it's more typesafe.
Can we update these?
component="label" | ||
variant="contained" | ||
startIcon={<CloudUploadIcon />} | ||
href="#file-upload" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oliviertassinari Base UI button adds the In Material UI, if we create a |
Closes #38766
https://deploy-preview-38786--material-ui.netlify.app/material-ui/react-button/#file-upload