@micromag/core 0.4.20 → 0.4.23
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/es/components.js +8 -3
- package/lib/components.js +7 -2
- package/package.json +2 -2
package/es/components.js
CHANGED
|
@@ -39,7 +39,7 @@ import { faTimes } from '@fortawesome/free-solid-svg-icons/faTimes';
|
|
|
39
39
|
import { faCircle } from '@fortawesome/free-solid-svg-icons/faCircle';
|
|
40
40
|
import { faPercent } from '@fortawesome/free-solid-svg-icons/faPercent';
|
|
41
41
|
import { getSizeWithinBounds } from '@folklore/size';
|
|
42
|
-
import { useSpring } from '@react-spring/core';
|
|
42
|
+
import { useSpringRef, useSpring } from '@react-spring/core';
|
|
43
43
|
import { config, animated } from '@react-spring/web';
|
|
44
44
|
|
|
45
45
|
/* eslint-disable react/jsx-props-no-spreading */
|
|
@@ -986,7 +986,7 @@ function Dropdown(_ref) {
|
|
|
986
986
|
enabled = _useState2[0],
|
|
987
987
|
setEnabled = _useState2[1];
|
|
988
988
|
var onDocumentClick = useCallback(function (e) {
|
|
989
|
-
if (refContainer.current && !refContainer.current.contains(e.currentTarget) && onClickOutside !== null) {
|
|
989
|
+
if (refContainer.current && !refContainer.current.contains(e.currentTarget) && !refContainer.current.contains(e.target) && onClickOutside !== null) {
|
|
990
990
|
onClickOutside(e);
|
|
991
991
|
}
|
|
992
992
|
}, [refContainer.current, onClickOutside]);
|
|
@@ -2907,8 +2907,13 @@ function Transition(_ref) {
|
|
|
2907
2907
|
onStart = _ref$onStart === void 0 ? null : _ref$onStart,
|
|
2908
2908
|
_ref$onComplete = _ref.onComplete,
|
|
2909
2909
|
onComplete = _ref$onComplete === void 0 ? null : _ref$onComplete;
|
|
2910
|
+
// In react-spring v10, useSpring(fn) without deps resets the spring on every render
|
|
2911
|
+
// via a layout effect. Passing a SpringRef prevents this reset behavior.
|
|
2912
|
+
var springRef = useSpringRef();
|
|
2910
2913
|
var _useSpring = useSpring(function () {
|
|
2911
|
-
return {
|
|
2914
|
+
return {
|
|
2915
|
+
ref: springRef
|
|
2916
|
+
};
|
|
2912
2917
|
}),
|
|
2913
2918
|
_useSpring2 = _slicedToArray(_useSpring, 2),
|
|
2914
2919
|
springProps = _useSpring2[0],
|
package/lib/components.js
CHANGED
|
@@ -988,7 +988,7 @@ function Dropdown(_ref) {
|
|
|
988
988
|
enabled = _useState2[0],
|
|
989
989
|
setEnabled = _useState2[1];
|
|
990
990
|
var onDocumentClick = React.useCallback(function (e) {
|
|
991
|
-
if (refContainer.current && !refContainer.current.contains(e.currentTarget) && onClickOutside !== null) {
|
|
991
|
+
if (refContainer.current && !refContainer.current.contains(e.currentTarget) && !refContainer.current.contains(e.target) && onClickOutside !== null) {
|
|
992
992
|
onClickOutside(e);
|
|
993
993
|
}
|
|
994
994
|
}, [refContainer.current, onClickOutside]);
|
|
@@ -2909,8 +2909,13 @@ function Transition(_ref) {
|
|
|
2909
2909
|
onStart = _ref$onStart === void 0 ? null : _ref$onStart,
|
|
2910
2910
|
_ref$onComplete = _ref.onComplete,
|
|
2911
2911
|
onComplete = _ref$onComplete === void 0 ? null : _ref$onComplete;
|
|
2912
|
+
// In react-spring v10, useSpring(fn) without deps resets the spring on every render
|
|
2913
|
+
// via a layout effect. Passing a SpringRef prevents this reset behavior.
|
|
2914
|
+
var springRef = core.useSpringRef();
|
|
2912
2915
|
var _useSpring = core.useSpring(function () {
|
|
2913
|
-
return {
|
|
2916
|
+
return {
|
|
2917
|
+
ref: springRef
|
|
2918
|
+
};
|
|
2914
2919
|
}),
|
|
2915
2920
|
_useSpring2 = _slicedToArray(_useSpring, 2),
|
|
2916
2921
|
springProps = _useSpring2[0],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.23",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -161,6 +161,6 @@
|
|
|
161
161
|
"access": "public",
|
|
162
162
|
"registry": "https://registry.npmjs.org/"
|
|
163
163
|
},
|
|
164
|
-
"gitHead": "
|
|
164
|
+
"gitHead": "57c581f5e1758b3d28152f68166cab0468670b92",
|
|
165
165
|
"types": "es/index.d.ts"
|
|
166
166
|
}
|