Skip to content

Commit e89abcd

Browse files
neon98oliviertassinari
authored andcommitted
[Tabs] Add new updateScrollButtonState() action (#17649)
1 parent 40fad15 commit e89abcd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

docs/pages/api/tabs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
2424

2525
| Name | Type | Default | Description |
2626
|:-----|:-----|:--------|:------------|
27-
| <span class="prop-name">action</span> | <span class="prop-type">ref</span> | | Callback fired when the component mounts. This is useful when you want to trigger an action programmatically. It currently only supports `updateIndicator()` action. |
27+
| <span class="prop-name">action</span> | <span class="prop-type">ref</span> | | Callback fired when the component mounts. This is useful when you want to trigger an action programmatically. It supports two actions: `updateIndicator()` and `updateScrollButtons()` |
2828
| <span class="prop-name">centered</span> | <span class="prop-type">bool</span> | <span class="prop-default">false</span> | If `true`, the tabs will be centered. This property is intended for large views. |
2929
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | The content of the component. |
3030
| <span class="prop-name">classes</span> | <span class="prop-type">object</span> | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |

packages/material-ui/src/Tabs/Tabs.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,9 @@ const Tabs = React.forwardRef(function Tabs(props, ref) {
360360
action,
361361
() => ({
362362
updateIndicator: updateIndicatorState,
363+
updateScrollButtons: updateScrollButtonState,
363364
}),
364-
[updateIndicatorState],
365+
[updateIndicatorState, updateScrollButtonState],
365366
);
366367

367368
const indicator = (
@@ -455,7 +456,7 @@ Tabs.propTypes = {
455456
/**
456457
* Callback fired when the component mounts.
457458
* This is useful when you want to trigger an action programmatically.
458-
* It currently only supports `updateIndicator()` action.
459+
* It supports two actions: `updateIndicator()` and `updateScrollButtons()`
459460
*
460461
* @param {object} actions This object contains all possible actions
461462
* that can be triggered programmatically.

0 commit comments

Comments
 (0)