react-day-picker 8.3.2 → 8.3.3

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/index.esm.js CHANGED
@@ -1262,7 +1262,14 @@ displayMonth) {
1262
1262
  return activeModifiers;
1263
1263
  }
1264
1264
 
1265
- /** Returns the day that should be the target of the focus when DayPicker is rendered the first time. */
1265
+ /**
1266
+ * Returns the day that should be the target of the focus when DayPicker is
1267
+ * rendered the first time.
1268
+ *
1269
+ * TODO: this function doesn't consider if the day is outside the month. We
1270
+ * implemented this check in `useDayRender` but it should probably go here. See
1271
+ * https://github.com/gpbl/react-day-picker/pull/1576
1272
+ */
1266
1273
  function getInitialFocusTarget(displayMonths, modifiers) {
1267
1274
  var firstDayInMonth = startOfMonth(displayMonths[0]);
1268
1275
  var lastDayInMonth = endOfMonth(displayMonths[displayMonths.length - 1]);
@@ -1738,7 +1745,9 @@ buttonRef) {
1738
1745
  children: children,
1739
1746
  'aria-label': ariaLabel
1740
1747
  };
1741
- var isFocusTarget = Boolean(focusContext.focusTarget && isSameDay(focusContext.focusTarget, day));
1748
+ var isFocusTarget = focusContext.focusTarget &&
1749
+ isSameDay(focusContext.focusTarget, day) &&
1750
+ !activeModifiers.outside;
1742
1751
  var buttonProps = __assign(__assign(__assign({}, divProps), (_a = { disabled: activeModifiers.disabled }, _a['aria-pressed'] = activeModifiers.selected, _a['aria-label'] = ariaLabel, _a.tabIndex = isFocusTarget ? 0 : -1, _a)), eventHandlers);
1743
1752
  var dayRender = {
1744
1753
  isButton: isButton,