@woosmap/ui 3.20.0 → 3.21.0
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
|
@@ -10,13 +10,17 @@ function mapChildrenWithProps(children, childrenRefs, closeCb) {
|
|
|
10
10
|
if (children) {
|
|
11
11
|
return React.Children.map(children, (child, index) => {
|
|
12
12
|
if (React.isValidElement(child)) {
|
|
13
|
+
// only add ref to non functional components
|
|
13
14
|
return React.cloneElement(child, {
|
|
14
15
|
...child.props,
|
|
15
16
|
closeCb,
|
|
16
|
-
ref:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
ref:
|
|
18
|
+
!child.type.prototype || (child.type.prototype && child.type.prototype.render)
|
|
19
|
+
? (elem) => {
|
|
20
|
+
// eslint-disable-next-line no-param-reassign
|
|
21
|
+
childrenRefs[index] = elem;
|
|
22
|
+
}
|
|
23
|
+
: undefined,
|
|
20
24
|
});
|
|
21
25
|
}
|
|
22
26
|
return child;
|
|
@@ -351,7 +355,7 @@ class Dropdown extends Component {
|
|
|
351
355
|
|
|
352
356
|
return (
|
|
353
357
|
<div
|
|
354
|
-
ref={this.clickOutsideRef}
|
|
358
|
+
ref={openOnMouseEnter ? null : this.clickOutsideRef}
|
|
355
359
|
className={cl('dropdown', { open }, `dropdown--${size}`, className)}
|
|
356
360
|
{...rest}
|
|
357
361
|
onMouseEnter={this.onMouseEnter}
|