haya-select 1.0.61 → 1.0.63
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 +1 -1
- package/src/select/index.jsx +6 -2
- package/src/select/option.jsx +1 -1
package/package.json
CHANGED
package/src/select/index.jsx
CHANGED
|
@@ -18,7 +18,11 @@ import useEventListener from "@kaspernj/api-maker/src/use-event-listener"
|
|
|
18
18
|
const nameForComponentWithMultiple = (component) => {
|
|
19
19
|
let name = nameForComponent(component)
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
const currentOptions = component.getCurrentOptions()
|
|
22
|
+
|
|
23
|
+
if (component.props.multiple && name && currentOptions.length > 0) {
|
|
24
|
+
name += "[]"
|
|
25
|
+
}
|
|
22
26
|
|
|
23
27
|
return name
|
|
24
28
|
}
|
|
@@ -118,7 +122,7 @@ export default memo(shapeComponent(class HayaSelect extends ShapeComponent {
|
|
|
118
122
|
useEffect(() => {
|
|
119
123
|
const currentOptionIds = this.s.currentOptions?.map((currentOption) => currentOption.value)
|
|
120
124
|
|
|
121
|
-
if (this.props.values && anythingDifferent(currentOptionIds, this.props.values)) {
|
|
125
|
+
if (this.props.values && anythingDifferent(currentOptionIds, this.props.values) && typeof this.props.options == "function") {
|
|
122
126
|
this.setCurrentFromGivenValues()
|
|
123
127
|
}
|
|
124
128
|
}, [this.props.values])
|
package/src/select/option.jsx
CHANGED
|
@@ -9,7 +9,7 @@ export default memo(shapeComponent(class Option extends ShapeComponent {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
static propTypes = {
|
|
12
|
-
currentOptionValues: PropTypes.array
|
|
12
|
+
currentOptionValues: PropTypes.array,
|
|
13
13
|
disabled: PropTypes.bool.isRequired,
|
|
14
14
|
icon: PropTypes.string,
|
|
15
15
|
onOptionClicked: PropTypes.func.isRequired,
|