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

Add support for Single Select Combobox #2

Open
koolamusic opened this issue Oct 5, 2020 · 11 comments
Open

Add support for Single Select Combobox #2

koolamusic opened this issue Oct 5, 2020 · 11 comments
Labels

Comments

@koolamusic
Copy link
Owner

This will be a wrapper around https://downshift.netlify.app/use-combobox
Will document thoughts while at it

@it-nalon
Copy link
Contributor

it-nalon commented Apr 23, 2021

I'm trying to figure out how this can be implemented.

For now, I found two ways to achieve the goal:

Incrementally adopted implementation

A first minor release that adds a multiple: boolean prop.
A second major release that ships two components (imported like this: import {CUIAutocomplete, CUIMultipleAutocomplete} from 'chakra-ui-autocomplete').

I think that we can implement the minor release splitting the index.tsx in three different files:

  • CUIAutocomplete.tsx/Autocomplete.tsx: single select combobox implemented with useCombobox() hook.
  • CUIMultipleAutocomplete.tsx/MultipleAutocomplete.tsx: current implementation of the Autocomplete.
  • index.tsx: a public Autocomplete component that add the multiple prop used to switch between the two components.

Pro: no breaking changes at first.
Cons: complicate typings in minor release.

Major release only

Like the "incrementally adopted implementation" but without the "minor release step", so just a new major version that ships two components instead of one.

Pro: Simpler to implement.
Cons: complete breaking changes.

What do you think?

@koolamusic
Copy link
Owner Author

koolamusic commented Apr 23, 2021

I'll go for a breaking change, as long as we can provide comprehensive documentation, the other versions of the app provide the compatibility required, because from here on moving forward, this will create the opportunity add features that are relevant to both workflows

@it-nalon
Copy link
Contributor

Hi everyone, I started working on the CUIAutoComplete+CUIMultipleAutoComplete components.
Right now I have a working example that I'm already using in one application.

It's still a big WIP full of copied code and other ugly things, I'll try to fix everything in the next few days.

The branch is here: feat-single-select-combobox

@koolamusic
Copy link
Owner Author

Thanks @it-nalon for taking this up, much appreciated. I reckon when you do get the chance to send a PR we can take a look at it.

@it-nalon
Copy link
Contributor

it-nalon commented Apr 30, 2021

Hi everyone, we have done some changes to the CUIAutoComplete component and we've tested everything all the week.
We need some time to document the new props and add some use cases in the README.

I have also some suggestions: upgrade tsdx to the latest version, add Storybook, change the naming from: "AutoComplete" to "Autocomplete", etc.

Maybe we can make a new branch with a npm package (with also a "next" Github label for iusses) where we can work togheter on this new version of the library.
@koolamusic what do you think?

@koolamusic
Copy link
Owner Author

Yeah, you beat me to storybook 😆 . let's create the next branch and work from there. these changes are welcome. Thanks for all the hard work on this. Much appreciated 🤝

@koolamusic
Copy link
Owner Author

@it-nalon any updates on this. let me know if you need some assistance

@it-nalon
Copy link
Contributor

@it-nalon any updates on this. let me know if you need some assistance

Hi @koolamusic, sorry for the delay.
I'll restart working on this project this weekend.
You can check the progress on my branch (or we can merge it here in this repository).

I correctly added Storybook and it works like a charm, just missing the documentation, the tests and the "Example" project in which I found some difficulties to make it run correctly.

We're already using this version in production since 1 month and it works perfectly for now.

Sorry again for the delay!

@koolamusic
Copy link
Owner Author

sure, sounds good to me.
What I think we might do is eliminate the examples project in favour of storybook and use that as demo for now until we figure out documentation. I'd prefer codesandbox sample projects and some decent docs atm.

Storybook is important right now as I wrote this for a project I was working on, however to start adding more features in isolation, I think it would be extremely beneficial to adopt storybook from now on-wards.

Meanwhile thanks for all the hard work on this one. Much appreciated

@it-nalon
Copy link
Contributor

Great!
Should I make a PR on dev branch o similiar?
I can make it before the weekend with some instructions in the README.md to run everything, but as I have already said without documentation and tests.

@koolamusic
Copy link
Owner Author

sure. feel free

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants