formik-mui icon indicating copy to clipboard operation
formik-mui copied to clipboard

Select contain box overlaps label

Open ziggy6792 opened this issue 3 years ago • 2 comments

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 avatar Mar 31 '22 11:03 ziggy6792

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 avatar Apr 23 '22 16:04 cliedeman

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

cliedeman avatar Apr 23 '22 16:04 cliedeman