bettersg / Mendisphere

Front end for Mendisphere
4 stars 5 forks source link

Make organisation listing filters multi select #92

Closed karthik-Jay closed 1 year ago

c6z3h commented 1 year ago

I wanna be ambitious here and say this one is an opportunity to contribute to chakra-ui library, see after 3 years nobody really made the multi-select lol https://github.com/chakra-ui/chakra-ui/issues/1293

Steps:

(the rest below is personal agenda)

karthik-Jay commented 1 year ago

Alright, let me know if you need a hand. I was initially thinking of using this https://github.com/bmartel/chakra-multiselect. We can consider it as a backup if you're hitting walls. but i have faith in you!

c6z3h commented 1 year ago

yup indeed going with the existing library is a good idea. The amount of code in his library to make it work was so much. Just to share, while I was trying to do multi-select, there was an issue of Mac putting a checkmark on selected options (Windows doesn't do that) that makes consistency between browsers difficult

Edit: seems more work is needed here, 2 solutions for multi-select have package.json that are out-of-date. Things tried:

  1. npm install chakra-multiselect (problem: dependency tree cannot resolve, mismatch version)
  2. npm install chakra-multiselect --legacy-peer-deps (problem: ignore above error, but module build failed)
  3. npm install chakra-multiselect@0.2.0 (problem: choose a version that fixes error 1, but cannot)
  4. Attempt to use another method https://codesandbox.io/s/0n0cu?file=/src/index.tsx which relies on @chakra-ui/core@0.8.0
  5. npm install @chakra-ui/core (problem: without and with version flag, build errors)

Solution: use another library https://www.npmjs.com/package/react-multi-select-component