5htp-core 0.2.7-8 → 0.2.7-9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "5htp-core",
3
3
  "description": "Convenient TypeScript framework designed for Performance and Productivity.",
4
- "version": "0.2.7-8",
4
+ "version": "0.2.7-9",
5
5
  "author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
6
6
  "repository": "git://github.com/gaetanlegac/5htp-core.git",
7
7
  "license": "MIT",
@@ -115,21 +115,6 @@ export default React.forwardRef<HTMLDivElement, Props>(({
115
115
  />
116
116
  )}
117
117
 
118
- {/*currentList.length !== 0 && (
119
- <ul class="col menu">
120
- {currentList.map(choice => (
121
- <Button size="s" onClick={() => {
122
- onChange( current => multiple
123
- ? current.filter(c => c.value !== choice.value)
124
- : undefined
125
- );
126
- }} suffix={<i src="check" class="fg primary" />}>
127
- {choice.label}
128
- </Button>
129
- ))}
130
- </ul>
131
- )*/}
132
-
133
118
  {choices === null ? (
134
119
  <div class="row h-3 al-center">
135
120
  <i src="spin" />
@@ -144,12 +129,16 @@ export default React.forwardRef<HTMLDivElement, Props>(({
144
129
 
145
130
  onChange( current => {
146
131
  return multiple
147
- ? [...(current || []), choice]
148
- : choice
132
+ ? (isCurrent
133
+ ? current.filter(c => c.value !== choice.value)
134
+ : [...(current || []), choice]
135
+ )
136
+ : (isCurrent
137
+ ? choice
138
+ : undefined
139
+ )
149
140
  });
150
141
 
151
- console.log("refDropdown?.current?.close", refDropdown, refDropdown?.current?.close);
152
-
153
142
  if (!multiple)
154
143
  refDropdown?.current?.close(true);
155
144