@alma/widgets 2.8.3 → 2.8.4

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.
@@ -2855,11 +2855,12 @@ const useButtonAnimation = (iterateValues, transitionDelay) => {
2855
2855
  const [current, setCurrent] = useState(0);
2856
2856
  const [update, setUpdate] = useState(true);
2857
2857
  useEffect(() => {
2858
+ let timeout;
2858
2859
  let isMounted = true;
2859
2860
 
2860
2861
  if (iterateValues.length !== 0) {
2861
2862
  if (!iterateValues.includes(current) && update) setCurrent(iterateValues[0]);
2862
- setTimeout(() => {
2863
+ timeout = setTimeout(() => {
2863
2864
  if (update && isMounted) {
2864
2865
  setCurrent(iterateValues[iterateValues.includes(current) ? (iterateValues.indexOf(current) + 1) % iterateValues.length : 0]);
2865
2866
  }
@@ -2868,6 +2869,7 @@ const useButtonAnimation = (iterateValues, transitionDelay) => {
2868
2869
 
2869
2870
  return () => {
2870
2871
  isMounted = false;
2872
+ clearTimeout(timeout);
2871
2873
  };
2872
2874
  }, [iterateValues, current]);
2873
2875
  return {
@@ -3040,7 +3042,9 @@ const PaymentPlanWidget = ({
3040
3042
  return /*#__PURE__*/React.createElement("div", {
3041
3043
  key: key,
3042
3044
  onMouseEnter: () => onHover(key),
3045
+ onTouchStart: () => onHover(key),
3043
3046
  onMouseOut: onLeave,
3047
+ onTouchEnd: onLeave,
3044
3048
  className: cx(s$c.plan, {
3045
3049
  [cx(s$c.active, STATIC_CUSTOMISATION_CLASSES$1.activeOption)]: isCurrent,
3046
3050
  [s$c.polychrome]: !monochrome && isCurrent,