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.
@@ -12846,15 +12846,21 @@ var NavTabs = /*#__PURE__*/React.forwardRef(function (props, ref) {
12846
12846
  return Object.keys(child.props).includes('isFocused');
12847
12847
  }
12848
12848
  });
12849
+ var handleNavTabFocus = function handleNavTabFocus(event) {
12850
+ var navTabElement = event.currentTarget;
12851
+ navTabElement.scrollIntoView({
12852
+ block: 'center',
12853
+ inline: 'center',
12854
+ behavior: 'smooth'
12855
+ });
12856
+ };
12849
12857
  var navTabsChildren = React.Children.map(children, function (child, i) {
12850
12858
  if (child && /*#__PURE__*/React.isValidElement(child) && child.type === NavTab) {
12851
12859
  var item = child;
12852
- if (!hasChildFocus && i === 0) {
12853
- return /*#__PURE__*/React.cloneElement(item, {
12854
- isFocused: true
12855
- });
12856
- }
12857
- return item;
12860
+ return /*#__PURE__*/React.cloneElement(item, {
12861
+ onFocus: handleNavTabFocus,
12862
+ isFocused: item.props.isFocused || !hasChildFocus && i === 0
12863
+ });
12858
12864
  }
12859
12865
  return child;
12860
12866
  });