Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #26 from chr-ge/fix/max-bypass-dble-click
Browse files Browse the repository at this point in the history
fix: add more than max options by double click fixed
  • Loading branch information
chr-ge authored May 5, 2021
2 parents 96f2235 + ffc72ba commit eb2435f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-column-select",
"version": "1.1.0",
"version": "1.1.1",
"description": "React component to select items from a column list.",
"scripts": {
"build": "rollup -c",
Expand Down
2 changes: 1 addition & 1 deletion src/ColumnSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const ColumnSelect: FC<ColumnSelectProps> = ({
)

const add = () => {
if (selectedOptions.find((c) => c.value === current.value)) return
if (selectedOptions.find((c) => c.value === current.value) || isMax) return
setSelectOptions(selectOptions.filter((o) => o.value !== current.value))
setSelectedOptions([...selectedOptions, current])

Expand Down

0 comments on commit eb2435f

Please sign in to comment.