Comparing version 2.7.2 to 2.7.3
@@ -92,5 +92,5 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2"; | ||
// ============================= Step ============================= | ||
var eventHandlers = React.useMemo(function () { | ||
var getEventHandlers = function getEventHandlers(targetStatus) { | ||
var _ref2, _ref3, _ref4; | ||
switch (status) { | ||
switch (targetStatus) { | ||
case STATUS_APPEAR: | ||
@@ -105,2 +105,5 @@ return _ref2 = {}, _defineProperty(_ref2, STEP_PREPARE, onAppearPrepare), _defineProperty(_ref2, STEP_START, onAppearStart), _defineProperty(_ref2, STEP_ACTIVE, onAppearActive), _ref2; | ||
} | ||
}; | ||
var eventHandlers = React.useMemo(function () { | ||
return getEventHandlers(status); | ||
}, [status]); | ||
@@ -172,7 +175,11 @@ var _useStepQueue = useStepQueue(status, !supportMotion, function (newStep) { | ||
} | ||
var nextEventHandlers = getEventHandlers(nextStatus); | ||
// Update to next status | ||
if (nextStatus) { | ||
if (nextStatus && (supportMotion || nextEventHandlers[STEP_PREPARE])) { | ||
setStatus(nextStatus); | ||
startStep(); | ||
} else { | ||
// Set back in case no motion but prev status has prepare step | ||
setStatus(STATUS_NONE); | ||
} | ||
@@ -179,0 +186,0 @@ }, [visible]); |
@@ -101,5 +101,5 @@ "use strict"; | ||
// ============================= Step ============================= | ||
var eventHandlers = React.useMemo(function () { | ||
var getEventHandlers = function getEventHandlers(targetStatus) { | ||
var _ref2, _ref3, _ref4; | ||
switch (status) { | ||
switch (targetStatus) { | ||
case _interface.STATUS_APPEAR: | ||
@@ -114,2 +114,5 @@ return _ref2 = {}, (0, _defineProperty2.default)(_ref2, _interface.STEP_PREPARE, onAppearPrepare), (0, _defineProperty2.default)(_ref2, _interface.STEP_START, onAppearStart), (0, _defineProperty2.default)(_ref2, _interface.STEP_ACTIVE, onAppearActive), _ref2; | ||
} | ||
}; | ||
var eventHandlers = React.useMemo(function () { | ||
return getEventHandlers(status); | ||
}, [status]); | ||
@@ -181,7 +184,11 @@ var _useStepQueue = (0, _useStepQueue3.default)(status, !supportMotion, function (newStep) { | ||
} | ||
var nextEventHandlers = getEventHandlers(nextStatus); | ||
// Update to next status | ||
if (nextStatus) { | ||
if (nextStatus && (supportMotion || nextEventHandlers[_interface.STEP_PREPARE])) { | ||
setStatus(nextStatus); | ||
startStep(); | ||
} else { | ||
// Set back in case no motion but prev status has prepare step | ||
setStatus(_interface.STATUS_NONE); | ||
} | ||
@@ -188,0 +195,0 @@ }, [visible]); |
{ | ||
"name": "rc-motion", | ||
"version": "2.7.2", | ||
"version": "2.7.3", | ||
"description": "React lifecycle controlled motion library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
107384
2213