react-magma-dom 5.1.0-rc.13 → 5.1.0-rc.14

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/esm/index.js CHANGED
@@ -17134,15 +17134,21 @@ var NavTabs = /*#__PURE__*/forwardRef(function (props, ref) {
17134
17134
  return Object.keys(child.props).includes('isFocused');
17135
17135
  }
17136
17136
  });
17137
+ var handleNavTabFocus = function handleNavTabFocus(event) {
17138
+ var navTabElement = event.currentTarget;
17139
+ navTabElement.scrollIntoView({
17140
+ block: 'center',
17141
+ inline: 'center',
17142
+ behavior: 'smooth'
17143
+ });
17144
+ };
17137
17145
  var navTabsChildren = Children.map(children, function (child, i) {
17138
17146
  if (child && /*#__PURE__*/isValidElement(child) && child.type === NavTab) {
17139
17147
  var item = child;
17140
- if (!hasChildFocus && i === 0) {
17141
- return /*#__PURE__*/cloneElement(item, {
17142
- isFocused: true
17143
- });
17144
- }
17145
- return item;
17148
+ return /*#__PURE__*/cloneElement(item, {
17149
+ onFocus: handleNavTabFocus,
17150
+ isFocused: item.props.isFocused || !hasChildFocus && i === 0
17151
+ });
17146
17152
  }
17147
17153
  return child;
17148
17154
  });