Closed angelvega93 closed 1 year ago
Chip is an interesting component, but it looks like my example was wrong.
Passing in the prop "multiple" seems to have fixed it in my example.
<Chip.Group multiple>
<Group position="center" mt="md">
<Chip value="1">Multiple chips</Chip>
<Chip value="2">Can be selected</Chip>
<Chip value="3">At a time</Chip>
</Group>
</Chip.Group>
Can you check to see if that fixes it for you too?
https://github.com/mantinedev/mantine/blob/master/src/mantine-core/src/Chip/ChipGroup/ChipGroup.tsx
You might get a type error with adding the prop multiple={true}, but it will still work. Seeing if there's a better than to just change my type to
export type ChipGroupProps<T extends FieldValues> = UseControllerProps<T> &
Omit<$ChipGroupProps<true>, "value" | "defaultValue">;
https://github.com/aranlucas/react-hook-form-mantine/pull/6/files
This was my best attempt at fixing the type issue. Let me know if that looks okay and I can go ahead and merge + release
Now works flawlessly, thanks.
Released https://github.com/aranlucas/react-hook-form-mantine/releases/tag/v1.0.10
Added ChipGroup example to https://codesandbox.io/s/react-hook-mantine-krflqj?file=/src/App.tsx
ref issue should also be fixed
I am currently encountering an error while attempting to utilize the Chip Group functionality. The error message displayed is as follows:
The example of the code being used:
Additionally, within the example Storybook, is not possible to deselect. https://aranlucas.github.io/react-hook-form-mantine/?path=/story/components-chip--chip-group