Choices icon indicating copy to clipboard operation
Choices copied to clipboard

Added multi class functionality

Open mikebronner opened this issue 4 years ago • 7 comments

Description

This PR attempts to implement allowing multi-class configs for all elements across the board.

    classNames: {
      containerOuter: 'choices',
      containerInner: 'choices__inner class2 class3', //this works for any of these className options
      input: 'choices__input',
      inputCloned: 'choices__input--cloned',
      list: 'choices__list',
      listItems: 'choices__list--multiple',
      listSingle: 'choices__list--single',
      listDropdown: 'choices__list--dropdown',
      item: 'choices__item',
      itemSelectable: 'choices__item--selectable',
      itemDisabled: 'choices__item--disabled',
      itemChoice: 'choices__item--choice',
      placeholder: 'choices__placeholder',
      group: 'choices__group',
      groupHeading: 'choices__heading',
      button: 'choices__button',
      activeState: 'is-active',
      focusState: 'is-focused',
      openState: 'is-open',
      disabledState: 'is-disabled',
      highlightedState: 'is-highlighted',
      selectedState: 'is-selected',
      flippedState: 'is-flipped',
      loadingState: 'is-loading',
      noResults: 'has-no-results',
      noChoices: 'has-no-choices'
    },

Types of changes

  • [ ] Chore (tooling change or documentation change)
  • [ ] Refactor (non-breaking change which maintains existing functionality)
  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [X] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • [X] My code follows the code style of this project.
  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.

mikebronner avatar Sep 23 '20 20:09 mikebronner

@mikebronner I opened a PR to solve this issue 2month ago. #889. But this lib doesn't seem to be maintained anymore.

Matth10 avatar Oct 01 '20 20:10 Matth10

HI @Matth10, yea I saw that :) I updated additional code that your PR didn't cover. :) But I have moved on as well, I could not get this package to work well with tailwind at all, because it relies on nested CSS class rules for formatting. I ended up building my drop-down from scratch.

mikebronner avatar Oct 01 '20 20:10 mikebronner

But I have moved on as well, I could not get this package to work well with tailwind at all, because it relies on nested CSS class rules for formatting. I ended up building my drop-down from scratch.

Yes this is exactly our cases. And I think I will also end up building my own one too.

Matth10 avatar Oct 01 '20 21:10 Matth10

@Matth10 @mikebronner what did you guys end up with?

ju5t avatar Jan 28 '21 07:01 ju5t

@ju5t I needed up writing my own from scratch.

mikebronner avatar Jan 28 '21 14:01 mikebronner

This would be great functionality to add. If you are still interested in getting this merged, I think it makes more sense to require multiple classes be provided as an array instead of doing all the string splitting internally.

If you aren't interested in making the change anymore just let us know.

mtriff avatar Dec 19 '21 14:12 mtriff

@mtriff Sorry, we have moved on at this point. If you would like to continue working on this PR and refining it, that would be great.

mikebronner avatar Dec 20 '21 13:12 mikebronner

hi @mtriff ,

I just made the PR #1074 to finalize this feature. Tell me if you need some changes.

regards

gaetan-hexadog avatar Nov 20 '22 12:11 gaetan-hexadog