@react-aria/calendar 3.3.0 → 3.4.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.
package/dist/import.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {announce as $amWdn$announce} from "@react-aria/live-announcer";
2
- import {filterDOMProps as $amWdn$filterDOMProps, useUpdateEffect as $amWdn$useUpdateEffect, useSlotId as $amWdn$useSlotId, useLabels as $amWdn$useLabels, mergeProps as $amWdn$mergeProps, useEvent as $amWdn$useEvent, useDescription as $amWdn$useDescription, focusWithoutScrolling as $amWdn$focusWithoutScrolling, scrollIntoViewport as $amWdn$scrollIntoViewport, getScrollParent as $amWdn$getScrollParent} from "@react-aria/utils";
2
+ import {filterDOMProps as $amWdn$filterDOMProps, useUpdateEffect as $amWdn$useUpdateEffect, useSlotId as $amWdn$useSlotId, useLabels as $amWdn$useLabels, mergeProps as $amWdn$mergeProps, useEvent as $amWdn$useEvent, useDeepMemo as $amWdn$useDeepMemo, useDescription as $amWdn$useDescription, focusWithoutScrolling as $amWdn$focusWithoutScrolling, scrollIntoViewport as $amWdn$scrollIntoViewport, getScrollParent as $amWdn$getScrollParent} from "@react-aria/utils";
3
3
  import {useLocalizedStringFormatter as $amWdn$useLocalizedStringFormatter, useDateFormatter as $amWdn$useDateFormatter, useLocale as $amWdn$useLocale} from "@react-aria/i18n";
4
- import {useRef as $amWdn$useRef, useMemo as $amWdn$useMemo, useEffect as $amWdn$useEffect} from "react";
4
+ import {useState as $amWdn$useState, useMemo as $amWdn$useMemo, useRef as $amWdn$useRef, useEffect as $amWdn$useEffect} from "react";
5
5
  import {isSameDay as $amWdn$isSameDay, startOfMonth as $amWdn$startOfMonth, endOfMonth as $amWdn$endOfMonth, startOfWeek as $amWdn$startOfWeek, today as $amWdn$today, isEqualDay as $amWdn$isEqualDay, isToday as $amWdn$isToday} from "@internationalized/date";
6
6
  import {usePress as $amWdn$usePress, getInteractionModality as $amWdn$getInteractionModality} from "@react-aria/interactions";
7
7
 
@@ -51,7 +51,7 @@ function $parcel$interopDefault(a) {
51
51
  * OF ANY KIND, either express or implied. See the License for the specific language
52
52
  * governing permissions and limitations under the License.
53
53
  */
54
- var $0fbdc3429b133a50$exports = {};
54
+ var $3904726b442bd9b2$exports = {};
55
55
  var $39324ace0d945f59$exports = {};
56
56
  $39324ace0d945f59$exports = {
57
57
  "dateRange": (args)=>`${args.startDate} إلى ${args.endDate}`,
@@ -599,7 +599,7 @@ $82649816f530bb1b$exports = {
599
599
  var $628e140a43dfb330$exports = {};
600
600
  $628e140a43dfb330$exports = {
601
601
  "dateRange": (args)=>`${args.startDate} 至 ${args.endDate}`,
602
- "dateSelected": (args)=>`已选定 ${args.date}`,
602
+ "dateSelected": (args)=>`已选择 ${args.date}`,
603
603
  "finishRangeSelectionPrompt": `单击以完成选择日期范围`,
604
604
  "maximumDate": `最后一个可用日期`,
605
605
  "minimumDate": `第一个可用日期`,
@@ -609,7 +609,7 @@ $628e140a43dfb330$exports = {
609
609
  "selectedRangeDescription": (args)=>`选定的范围:${args.dateRange}`,
610
610
  "startRangeSelectionPrompt": `单击以开始选择日期范围`,
611
611
  "todayDate": (args)=>`今天,即 ${args.date}`,
612
- "todayDateSelected": (args)=>`已选定今天,即 ${args.date}`
612
+ "todayDateSelected": (args)=>`已选择今天,即 ${args.date}`
613
613
  };
614
614
 
615
615
 
@@ -630,7 +630,7 @@ $745937250cd4679c$exports = {
630
630
  };
631
631
 
632
632
 
633
- $0fbdc3429b133a50$exports = {
633
+ $3904726b442bd9b2$exports = {
634
634
  "ar-AE": $39324ace0d945f59$exports,
635
635
  "bg-BG": $1830a539e98c7baf$exports,
636
636
  "cs-CZ": $f4b92528965aab97$exports,
@@ -675,7 +675,7 @@ function $a074e1e2d0f0a665$export$134cbb7fb09a9522(date) {
675
675
  return (date === null || date === void 0 ? void 0 : date.calendar.identifier) === "gregory" && date.era === "BC" ? "short" : undefined;
676
676
  }
677
677
  function $a074e1e2d0f0a665$export$b6df97c887c38e1a(state) {
678
- let stringFormatter = (0, $amWdn$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($0fbdc3429b133a50$exports))));
678
+ let stringFormatter = (0, $amWdn$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($3904726b442bd9b2$exports))));
679
679
  let start, end;
680
680
  if ("highlightedRange" in state) ({ start: start , end: end } = state.highlightedRange || {});
681
681
  else start = end = state.value;
@@ -716,7 +716,7 @@ function $a074e1e2d0f0a665$export$b6df97c887c38e1a(state) {
716
716
  ]);
717
717
  }
718
718
  function $a074e1e2d0f0a665$export$31afe65d91ef6e8(startDate, endDate, timeZone, isAria) {
719
- let stringFormatter = (0, $amWdn$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($0fbdc3429b133a50$exports))));
719
+ let stringFormatter = (0, $amWdn$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($3904726b442bd9b2$exports))));
720
720
  let era = $a074e1e2d0f0a665$export$134cbb7fb09a9522(startDate) || $a074e1e2d0f0a665$export$134cbb7fb09a9522(endDate);
721
721
  let monthFormatter = (0, $amWdn$useDateFormatter)({
722
722
  month: "long",
@@ -764,9 +764,9 @@ function $a074e1e2d0f0a665$var$formatRange(dateFormatter, stringFormatter, start
764
764
  // Now we can combine the parts into start and end strings.
765
765
  let startValue = "";
766
766
  let endValue = "";
767
- for(let i1 = 0; i1 < parts.length; i1++){
768
- if (i1 < separatorIndex) startValue += parts[i1].value;
769
- else if (i1 > separatorIndex) endValue += parts[i1].value;
767
+ for(let i = 0; i < parts.length; i++){
768
+ if (i < separatorIndex) startValue += parts[i].value;
769
+ else if (i > separatorIndex) endValue += parts[i].value;
770
770
  }
771
771
  return stringFormatter.format("dateRange", {
772
772
  startDate: startValue,
@@ -779,7 +779,7 @@ function $a074e1e2d0f0a665$var$formatRange(dateFormatter, stringFormatter, start
779
779
 
780
780
 
781
781
  function $c4acc1de3ab169cf$export$d652b3ea2d672d5b(props, state) {
782
- let stringFormatter = (0, $amWdn$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($0fbdc3429b133a50$exports))));
782
+ let stringFormatter = (0, $amWdn$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($3904726b442bd9b2$exports))));
783
783
  let domProps = (0, $amWdn$filterDOMProps)(props);
784
784
  let title = (0, $a074e1e2d0f0a665$export$31afe65d91ef6e8)(state.visibleRange.start, state.visibleRange.end, state.timeZone, false);
785
785
  let visibleRangeDescription = (0, $a074e1e2d0f0a665$export$31afe65d91ef6e8)(state.visibleRange.start, state.visibleRange.end, state.timeZone, true);
@@ -810,16 +810,16 @@ function $c4acc1de3ab169cf$export$d652b3ea2d672d5b(props, state) {
810
810
  selectedDateDescription: selectedDateDescription
811
811
  });
812
812
  // If the next or previous buttons become disabled while they are focused, move focus to the calendar body.
813
- let nextFocused = (0, $amWdn$useRef)(false);
813
+ let [nextFocused, setNextFocused] = (0, $amWdn$useState)(false);
814
814
  let nextDisabled = props.isDisabled || state.isNextVisibleRangeInvalid();
815
- if (nextDisabled && nextFocused.current) {
816
- nextFocused.current = false;
815
+ if (nextDisabled && nextFocused) {
816
+ setNextFocused(false);
817
817
  state.setFocused(true);
818
818
  }
819
- let previousFocused = (0, $amWdn$useRef)(false);
819
+ let [previousFocused, setPreviousFocused] = (0, $amWdn$useState)(false);
820
820
  let previousDisabled = props.isDisabled || state.isPreviousVisibleRangeInvalid();
821
- if (previousDisabled && previousFocused.current) {
822
- previousFocused.current = false;
821
+ if (previousDisabled && previousFocused) {
822
+ setPreviousFocused(false);
823
823
  state.setFocused(true);
824
824
  }
825
825
  let labelProps = (0, $amWdn$useLabels)({
@@ -832,22 +832,20 @@ function $c4acc1de3ab169cf$export$d652b3ea2d672d5b(props, state) {
832
832
  });
833
833
  return {
834
834
  calendarProps: (0, $amWdn$mergeProps)(domProps, labelProps, {
835
- role: "group",
835
+ role: "application",
836
836
  "aria-describedby": props["aria-describedby"] || undefined
837
837
  }),
838
838
  nextButtonProps: {
839
839
  onPress: ()=>state.focusNextPage(),
840
840
  "aria-label": stringFormatter.format("next"),
841
841
  isDisabled: nextDisabled,
842
- onFocus: ()=>nextFocused.current = true,
843
- onBlur: ()=>nextFocused.current = false
842
+ onFocusChange: setNextFocused
844
843
  },
845
844
  prevButtonProps: {
846
845
  onPress: ()=>state.focusPreviousPage(),
847
846
  "aria-label": stringFormatter.format("previous"),
848
847
  isDisabled: previousDisabled,
849
- onFocus: ()=>previousFocused.current = true,
850
- onBlur: ()=>previousFocused.current = false
848
+ onFocusChange: setPreviousFocused
851
849
  },
852
850
  errorMessageProps: {
853
851
  id: errorMessageId
@@ -1061,11 +1059,10 @@ function $e3031d1f8c9d64eb$export$cb95147730a423f5(props, state) {
1061
1059
 
1062
1060
 
1063
1061
 
1064
-
1065
1062
  function $36a0ac60f04457c5$export$136073280381448e(props, state, ref) {
1066
1063
  let { date: date , isDisabled: isDisabled } = props;
1067
1064
  let { errorMessageId: errorMessageId , selectedDateDescription: selectedDateDescription } = (0, $a074e1e2d0f0a665$export$653eddfc964b0f8a).get(state);
1068
- let stringFormatter = (0, $amWdn$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($0fbdc3429b133a50$exports))));
1065
+ let stringFormatter = (0, $amWdn$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($3904726b442bd9b2$exports))));
1069
1066
  let dateFormatter = (0, $amWdn$useDateFormatter)({
1070
1067
  weekday: "long",
1071
1068
  day: "numeric",
@@ -1083,9 +1080,7 @@ function $36a0ac60f04457c5$export$136073280381448e(props, state, ref) {
1083
1080
  if (isInvalid) isSelected = true;
1084
1081
  // For performance, reuse the same date object as before if the new date prop is the same.
1085
1082
  // This allows subsequent useMemo results to be reused.
1086
- let lastDate = (0, $amWdn$useRef)(null);
1087
- if (lastDate.current && (0, $amWdn$isEqualDay)(date, lastDate.current)) date = lastDate.current;
1088
- lastDate.current = date;
1083
+ date = (0, $amWdn$useDeepMemo)(date, (0, $amWdn$isEqualDay));
1089
1084
  let nativeDate = (0, $amWdn$useMemo)(()=>date.toDate(state.timeZone), [
1090
1085
  date,
1091
1086
  state.timeZone
@@ -1236,8 +1231,11 @@ function $36a0ac60f04457c5$export$136073280381448e(props, state, ref) {
1236
1231
  // Scroll into view if navigating with a keyboard, otherwise
1237
1232
  // try not to shift the view under the user's mouse/finger.
1238
1233
  // If in a overlay, scrollIntoViewport will only cause scrolling
1239
- // up to the overlay scroll body to prevent overlay shifting
1240
- if ((0, $amWdn$getInteractionModality)() !== "pointer") (0, $amWdn$scrollIntoViewport)(ref.current, {
1234
+ // up to the overlay scroll body to prevent overlay shifting.
1235
+ // Also only scroll into view if the cell actually got focused.
1236
+ // There are some cases where the cell might be disabled or inside,
1237
+ // an inert container and we don't want to scroll then.
1238
+ if ((0, $amWdn$getInteractionModality)() !== "pointer" && document.activeElement === ref.current) (0, $amWdn$scrollIntoViewport)(ref.current, {
1241
1239
  containingElement: (0, $amWdn$getScrollParent)(ref.current)
1242
1240
  });
1243
1241
  }
package/dist/main.js CHANGED
@@ -59,7 +59,7 @@ $parcel$export(module.exports, "useCalendarCell", () => $4d833327a32c9193$export
59
59
  * OF ANY KIND, either express or implied. See the License for the specific language
60
60
  * governing permissions and limitations under the License.
61
61
  */
62
- var $f87cd00fb2ba0f23$exports = {};
62
+ var $bd6dc95a3c5ee5cd$exports = {};
63
63
  var $1fedb39dedbf7c51$exports = {};
64
64
  $1fedb39dedbf7c51$exports = {
65
65
  "dateRange": (args)=>`${args.startDate} إلى ${args.endDate}`,
@@ -607,7 +607,7 @@ $16bef71241a84fd2$exports = {
607
607
  var $c80940728ad8dc0d$exports = {};
608
608
  $c80940728ad8dc0d$exports = {
609
609
  "dateRange": (args)=>`${args.startDate} 至 ${args.endDate}`,
610
- "dateSelected": (args)=>`已选定 ${args.date}`,
610
+ "dateSelected": (args)=>`已选择 ${args.date}`,
611
611
  "finishRangeSelectionPrompt": `单击以完成选择日期范围`,
612
612
  "maximumDate": `最后一个可用日期`,
613
613
  "minimumDate": `第一个可用日期`,
@@ -617,7 +617,7 @@ $c80940728ad8dc0d$exports = {
617
617
  "selectedRangeDescription": (args)=>`选定的范围:${args.dateRange}`,
618
618
  "startRangeSelectionPrompt": `单击以开始选择日期范围`,
619
619
  "todayDate": (args)=>`今天,即 ${args.date}`,
620
- "todayDateSelected": (args)=>`已选定今天,即 ${args.date}`
620
+ "todayDateSelected": (args)=>`已选择今天,即 ${args.date}`
621
621
  };
622
622
 
623
623
 
@@ -638,7 +638,7 @@ $ec192a5a83cfafeb$exports = {
638
638
  };
639
639
 
640
640
 
641
- $f87cd00fb2ba0f23$exports = {
641
+ $bd6dc95a3c5ee5cd$exports = {
642
642
  "ar-AE": $1fedb39dedbf7c51$exports,
643
643
  "bg-BG": $524ada6153e36bf5$exports,
644
644
  "cs-CZ": $181053d31fc585a6$exports,
@@ -683,7 +683,7 @@ function $df1d8e967e73ec8e$export$134cbb7fb09a9522(date) {
683
683
  return (date === null || date === void 0 ? void 0 : date.calendar.identifier) === "gregory" && date.era === "BC" ? "short" : undefined;
684
684
  }
685
685
  function $df1d8e967e73ec8e$export$b6df97c887c38e1a(state) {
686
- let stringFormatter = (0, $jzHdg$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($f87cd00fb2ba0f23$exports))));
686
+ let stringFormatter = (0, $jzHdg$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($bd6dc95a3c5ee5cd$exports))));
687
687
  let start, end;
688
688
  if ("highlightedRange" in state) ({ start: start , end: end } = state.highlightedRange || {});
689
689
  else start = end = state.value;
@@ -724,7 +724,7 @@ function $df1d8e967e73ec8e$export$b6df97c887c38e1a(state) {
724
724
  ]);
725
725
  }
726
726
  function $df1d8e967e73ec8e$export$31afe65d91ef6e8(startDate, endDate, timeZone, isAria) {
727
- let stringFormatter = (0, $jzHdg$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($f87cd00fb2ba0f23$exports))));
727
+ let stringFormatter = (0, $jzHdg$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($bd6dc95a3c5ee5cd$exports))));
728
728
  let era = $df1d8e967e73ec8e$export$134cbb7fb09a9522(startDate) || $df1d8e967e73ec8e$export$134cbb7fb09a9522(endDate);
729
729
  let monthFormatter = (0, $jzHdg$reactariai18n.useDateFormatter)({
730
730
  month: "long",
@@ -772,9 +772,9 @@ function $df1d8e967e73ec8e$var$formatRange(dateFormatter, stringFormatter, start
772
772
  // Now we can combine the parts into start and end strings.
773
773
  let startValue = "";
774
774
  let endValue = "";
775
- for(let i1 = 0; i1 < parts.length; i1++){
776
- if (i1 < separatorIndex) startValue += parts[i1].value;
777
- else if (i1 > separatorIndex) endValue += parts[i1].value;
775
+ for(let i = 0; i < parts.length; i++){
776
+ if (i < separatorIndex) startValue += parts[i].value;
777
+ else if (i > separatorIndex) endValue += parts[i].value;
778
778
  }
779
779
  return stringFormatter.format("dateRange", {
780
780
  startDate: startValue,
@@ -787,7 +787,7 @@ function $df1d8e967e73ec8e$var$formatRange(dateFormatter, stringFormatter, start
787
787
 
788
788
 
789
789
  function $02ef492a56b91cb2$export$d652b3ea2d672d5b(props, state) {
790
- let stringFormatter = (0, $jzHdg$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($f87cd00fb2ba0f23$exports))));
790
+ let stringFormatter = (0, $jzHdg$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($bd6dc95a3c5ee5cd$exports))));
791
791
  let domProps = (0, $jzHdg$reactariautils.filterDOMProps)(props);
792
792
  let title = (0, $df1d8e967e73ec8e$export$31afe65d91ef6e8)(state.visibleRange.start, state.visibleRange.end, state.timeZone, false);
793
793
  let visibleRangeDescription = (0, $df1d8e967e73ec8e$export$31afe65d91ef6e8)(state.visibleRange.start, state.visibleRange.end, state.timeZone, true);
@@ -818,16 +818,16 @@ function $02ef492a56b91cb2$export$d652b3ea2d672d5b(props, state) {
818
818
  selectedDateDescription: selectedDateDescription
819
819
  });
820
820
  // If the next or previous buttons become disabled while they are focused, move focus to the calendar body.
821
- let nextFocused = (0, $jzHdg$react.useRef)(false);
821
+ let [nextFocused, setNextFocused] = (0, $jzHdg$react.useState)(false);
822
822
  let nextDisabled = props.isDisabled || state.isNextVisibleRangeInvalid();
823
- if (nextDisabled && nextFocused.current) {
824
- nextFocused.current = false;
823
+ if (nextDisabled && nextFocused) {
824
+ setNextFocused(false);
825
825
  state.setFocused(true);
826
826
  }
827
- let previousFocused = (0, $jzHdg$react.useRef)(false);
827
+ let [previousFocused, setPreviousFocused] = (0, $jzHdg$react.useState)(false);
828
828
  let previousDisabled = props.isDisabled || state.isPreviousVisibleRangeInvalid();
829
- if (previousDisabled && previousFocused.current) {
830
- previousFocused.current = false;
829
+ if (previousDisabled && previousFocused) {
830
+ setPreviousFocused(false);
831
831
  state.setFocused(true);
832
832
  }
833
833
  let labelProps = (0, $jzHdg$reactariautils.useLabels)({
@@ -840,22 +840,20 @@ function $02ef492a56b91cb2$export$d652b3ea2d672d5b(props, state) {
840
840
  });
841
841
  return {
842
842
  calendarProps: (0, $jzHdg$reactariautils.mergeProps)(domProps, labelProps, {
843
- role: "group",
843
+ role: "application",
844
844
  "aria-describedby": props["aria-describedby"] || undefined
845
845
  }),
846
846
  nextButtonProps: {
847
847
  onPress: ()=>state.focusNextPage(),
848
848
  "aria-label": stringFormatter.format("next"),
849
849
  isDisabled: nextDisabled,
850
- onFocus: ()=>nextFocused.current = true,
851
- onBlur: ()=>nextFocused.current = false
850
+ onFocusChange: setNextFocused
852
851
  },
853
852
  prevButtonProps: {
854
853
  onPress: ()=>state.focusPreviousPage(),
855
854
  "aria-label": stringFormatter.format("previous"),
856
855
  isDisabled: previousDisabled,
857
- onFocus: ()=>previousFocused.current = true,
858
- onBlur: ()=>previousFocused.current = false
856
+ onFocusChange: setPreviousFocused
859
857
  },
860
858
  errorMessageProps: {
861
859
  id: errorMessageId
@@ -1069,11 +1067,10 @@ function $a07388a797d86b95$export$cb95147730a423f5(props, state) {
1069
1067
 
1070
1068
 
1071
1069
 
1072
-
1073
1070
  function $4d833327a32c9193$export$136073280381448e(props, state, ref) {
1074
1071
  let { date: date , isDisabled: isDisabled } = props;
1075
1072
  let { errorMessageId: errorMessageId , selectedDateDescription: selectedDateDescription } = (0, $df1d8e967e73ec8e$export$653eddfc964b0f8a).get(state);
1076
- let stringFormatter = (0, $jzHdg$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($f87cd00fb2ba0f23$exports))));
1073
+ let stringFormatter = (0, $jzHdg$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($bd6dc95a3c5ee5cd$exports))));
1077
1074
  let dateFormatter = (0, $jzHdg$reactariai18n.useDateFormatter)({
1078
1075
  weekday: "long",
1079
1076
  day: "numeric",
@@ -1091,9 +1088,7 @@ function $4d833327a32c9193$export$136073280381448e(props, state, ref) {
1091
1088
  if (isInvalid) isSelected = true;
1092
1089
  // For performance, reuse the same date object as before if the new date prop is the same.
1093
1090
  // This allows subsequent useMemo results to be reused.
1094
- let lastDate = (0, $jzHdg$react.useRef)(null);
1095
- if (lastDate.current && (0, $jzHdg$internationalizeddate.isEqualDay)(date, lastDate.current)) date = lastDate.current;
1096
- lastDate.current = date;
1091
+ date = (0, $jzHdg$reactariautils.useDeepMemo)(date, (0, $jzHdg$internationalizeddate.isEqualDay));
1097
1092
  let nativeDate = (0, $jzHdg$react.useMemo)(()=>date.toDate(state.timeZone), [
1098
1093
  date,
1099
1094
  state.timeZone
@@ -1244,8 +1239,11 @@ function $4d833327a32c9193$export$136073280381448e(props, state, ref) {
1244
1239
  // Scroll into view if navigating with a keyboard, otherwise
1245
1240
  // try not to shift the view under the user's mouse/finger.
1246
1241
  // If in a overlay, scrollIntoViewport will only cause scrolling
1247
- // up to the overlay scroll body to prevent overlay shifting
1248
- if ((0, $jzHdg$reactariainteractions.getInteractionModality)() !== "pointer") (0, $jzHdg$reactariautils.scrollIntoViewport)(ref.current, {
1242
+ // up to the overlay scroll body to prevent overlay shifting.
1243
+ // Also only scroll into view if the cell actually got focused.
1244
+ // There are some cases where the cell might be disabled or inside,
1245
+ // an inert container and we don't want to scroll then.
1246
+ if ((0, $jzHdg$reactariainteractions.getInteractionModality)() !== "pointer" && document.activeElement === ref.current) (0, $jzHdg$reactariautils.scrollIntoViewport)(ref.current, {
1249
1247
  containingElement: (0, $jzHdg$reactariautils.getScrollParent)(ref.current)
1250
1248
  });
1251
1249
  }