haya-select 1.0.62 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "haya-select",
3
- "version": "1.0.62",
3
+ "version": "1.0.63",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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
- if (component.props.multiple && name) name += "[]"
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
  }
@@ -9,7 +9,7 @@ export default memo(shapeComponent(class Option extends ShapeComponent {
9
9
  }
10
10
 
11
11
  static propTypes = {
12
- currentOptionValues: PropTypes.array.isRequired,
12
+ currentOptionValues: PropTypes.array,
13
13
  disabled: PropTypes.bool.isRequired,
14
14
  icon: PropTypes.string,
15
15
  onOptionClicked: PropTypes.func.isRequired,