Skip to content

Commit

Permalink
fix buttons to appear on scrollButtons=on
Browse files Browse the repository at this point in the history
  • Loading branch information
neon98 committed Oct 1, 2019
1 parent 05c533b commit 0d2132d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/pages/api/tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <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. |
| <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()` |
| <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. |
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | The content of the component. |
| <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. |
Expand Down
5 changes: 3 additions & 2 deletions packages/material-ui/src/Tabs/Tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,9 @@ const Tabs = React.forwardRef(function Tabs(props, ref) {
action,
() => ({
updateIndicator: updateIndicatorState,
updateScrollButtons: updateScrollButtonState,
}),
[updateIndicatorState],
[updateIndicatorState, updateScrollButtonState],
);

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

0 comments on commit 0d2132d

Please sign in to comment.