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

custom multiple select #227

Open
czesuaf92 opened this issue Nov 24, 2020 · 2 comments
Open

custom multiple select #227

czesuaf92 opened this issue Nov 24, 2020 · 2 comments
Labels
question Further information is requested waiting-on-reply

Comments

@czesuaf92
Copy link

czesuaf92 commented Nov 24, 2020

Hi i create multiple select with custom styles in dropdown list.
image
image
Is it possible delete from value in input [Object, Object]?
Here is my code

const useStyles = makeStyles((theme: Theme) => ({
  multipleMenuItem: {
    position: "relative",
    "& .MuiSvgIcon-root": {
      display: "none",
    },
    "&.Mui-selected .MuiSvgIcon-root": {
      display: "block",
      position: "absolute",
      right: theme.spacing(1),
      color: theme.palette.tint.main,
    },
  },
}));
<Field
          component={TextField}
          type="text"
          name="tags"
          select
          SelectProps={{
            multiple: true,
            
          }}
          label="Hashtags"
          fullWidth
          variant="outlined"
          margin="normal"
        >
          {tags.map((tag) => (
            <MenuItem
              value={tag.id}
              key={tag.id}
              className={styles.multipleMenuItem}
            >
              {formatTag(tag.name)}
              <CloseIcon />
            </MenuItem>
          ))}
        </Field>
@cliedeman cliedeman added question Further information is requested waiting-on-reply labels Dec 14, 2020
@cliedeman
Copy link
Collaborator

@czesuaf92 if you create a codesandbox I can take a look

@frankchau93
Copy link

I get the same issue when I add a checkbox component in the MenuItem component. Seems like it only works if there's no other component inside the MenuItem. @cliedeman try adding a checkbox component inside your menuitem multiple select example and you'll see it.

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

3 participants