Skip to content

Commit

Permalink
feat(Tabs): support additional overflow button props
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod committed Dec 10, 2020
1 parent be67e81 commit ef3e9ef
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions packages/react/src/components/Tabs/Tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export default class Tabs extends React.Component {
*/
hidden: PropTypes.bool,

/**
* Provide the props that describe the left overflow button
*/
leftOverflowButtonProps: PropTypes.object,

/**
* Specify whether or not to use the light component variant
*/
Expand All @@ -59,6 +64,11 @@ export default class Tabs extends React.Component {
*/
onSelectionChange: PropTypes.func,

/**
* Provide the props that describe the right overflow button
*/
rightOverflowButtonProps: PropTypes.object,

/**
* Choose whether or not to automatically scroll to newly selected tabs
* on component rerender
Expand Down Expand Up @@ -389,6 +399,8 @@ export default class Tabs extends React.Component {
scrollIntoView, // eslint-disable-line no-unused-vars
selectionMode, // eslint-disable-line no-unused-vars
tabContentClassName,
leftOverflowButtonProps,
rightOverflowButtonProps,
...other
} = this.props;

Expand Down Expand Up @@ -488,7 +500,8 @@ export default class Tabs extends React.Component {
onMouseUp={this.handleOverflowNavMouseUp}
ref={this.leftOverflowNavButton}
tabIndex="-1"
type="button">
type="button"
{...leftOverflowButtonProps}>
<ChevronLeft16 />
</button>
{!leftOverflowNavButtonHidden && (
Expand All @@ -515,7 +528,8 @@ export default class Tabs extends React.Component {
onMouseUp={this.handleOverflowNavMouseUp}
ref={this.rightOverflowNavButton}
tabIndex="-1"
type="button">
type="button"
{...rightOverflowButtonProps}>
<ChevronRight16 />
</button>
</div>
Expand Down

0 comments on commit ef3e9ef

Please sign in to comment.