@woosmap/ui 2.53.0 → 2.54.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;
|
|
@@ -349,7 +353,7 @@ class Dropdown extends Component {
|
|
|
349
353
|
|
|
350
354
|
return (
|
|
351
355
|
<div
|
|
352
|
-
ref={this.clickOutsideRef}
|
|
356
|
+
ref={openOnMouseEnter ? null : this.clickOutsideRef}
|
|
353
357
|
className={cl('dropdown', { open }, `dropdown--${size}`, className)}
|
|
354
358
|
{...rest}
|
|
355
359
|
onMouseEnter={this.onMouseEnter}
|