antd-mobile 5.41.0 → 5.41.1-alpha.1

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.
@@ -12285,6 +12285,7 @@ const Tabs$1 = (p) => {
12285
12285
  (_a2 = props.onChange) === null || _a2 === void 0 ? void 0 : _a2.call(props, v);
12286
12286
  }
12287
12287
  });
12288
+ const manuallyActiveRef = React$3.useRef(null);
12288
12289
  const [{
12289
12290
  x,
12290
12291
  width
@@ -12445,13 +12446,15 @@ const Tabs$1 = (p) => {
12445
12446
  const currentKey = findNextEnabledTab(currentIndex, offsetDirection);
12446
12447
  if (isNext || isPrev) {
12447
12448
  e2.preventDefault();
12449
+ manuallyActiveRef.current = currentKey;
12448
12450
  setActiveKey(currentKey);
12449
12451
  }
12450
12452
  };
12451
12453
  React$3.useEffect(() => {
12452
12454
  var _a2;
12453
- if (activeKey && tabRefs.current[activeKey]) {
12455
+ if (activeKey && tabRefs.current[activeKey] && manuallyActiveRef.current === activeKey) {
12454
12456
  (_a2 = tabRefs.current[activeKey]) === null || _a2 === void 0 ? void 0 : _a2.focus();
12457
+ manuallyActiveRef.current = null;
12455
12458
  }
12456
12459
  }, [activeKey]);
12457
12460
  return withNativeProps(props, React$3.createElement("div", {