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

Select contain box overlaps label #319

Open
ziggy6792 opened this issue Mar 31, 2022 · 2 comments
Open

Select contain box overlaps label #319

ziggy6792 opened this issue Mar 31, 2022 · 2 comments
Labels
question Further information is requested waiting-on-reply

Comments

@ziggy6792
Copy link

ziggy6792 commented Mar 31, 2022

Current Behavior 😯

In your Code Sandbox demo https://codesandbox.io/s/915qlr56rp the "tags" select field contain box overlaps the label. I now have the same issue in my app and I am not sure how to fix it. It seems like the label it not properly 'linked' to the select field.
Screenshot 2022-03-31 at 7 37 00 PM

Expected Behavior 🤔

Label should not intercept. Should look more like this.
Screenshot 2022-03-31 at 7 42 25 PM

Steps to Reproduce 🕹

Please see your Code Sandbox

Thanks a lot :)

@ziggy6792 ziggy6792 added the bug Something isn't working label Mar 31, 2022
@cliedeman
Copy link
Collaborator

cliedeman commented Apr 23, 2022

Hi @ziggy6792

I got the expected behaviour with

            <FormControl sx={{m: 1, minWidth: 120}}>
              <Field
                component={Select}
                type="text"
                label="Tags"
                name="tags"
                multiple={true}
              >
                <MenuItem value="dogs">Dogs</MenuItem>
                <MenuItem value="cats">Cats</MenuItem>
                <MenuItem value="rats">Rats</MenuItem>
                <MenuItem value="snakes">Snakes</MenuItem>
              </Field>
            </FormControl>

But this does not align with the docs.

https://mui.com/material-ui/react-select/#labels-and-helper-text

Not sure why the docs recommend an InputLabel when Select has a label prop

@cliedeman
Copy link
Collaborator

Ok I see now. It depends on which Select variant you are using

@cliedeman cliedeman added question Further information is requested waiting-on-reply and removed bug Something isn't working labels Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested waiting-on-reply
Projects
None yet
Development

No branches or pull requests

2 participants