viclafouch / mui-chips-input

📌 A chips input designed for MUI (Material ui) V6
https://viclafouch.github.io/mui-chips-input/
MIT License
83 stars 19 forks source link

Type error with prop multiline #4

Closed Elfayer closed 1 year ago

Elfayer commented 2 years ago

Describe the bug If I use <MuiChipsInput multiline rows={3} />, I get a type error. Note the prop actually work, it's just a type issue.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/ancient-field-jedk7g?file=/src/App.tsx
  2. See type error in code editor

Expected behavior The prop should not raise a type error.

Error is due to this line, I guess: https://github.com/viclafouch/mui-chips-input/blob/main/src/index.types.ts#L4

viclafouch commented 2 years ago

Hello @Elfayer

The component has not been developed to be compatible with a textarea. That's why "multiline" has been omitted from the types. In your opinion, does everything look right even with a textarea?

Elfayer commented 2 years ago

Actually there is 1 glitch: The number of rows stay the same, if I give rows={3}, and I have 2 lines of chips (+ the input), it'll still show 5 rows. Since the MuiChipsInput isn't actually the TextField it doesn't work.

viclafouch commented 1 year ago

Let's keep the multiline omitted for now.