diff --git a/src/components/Pagination/Pagination-test.js b/src/components/Pagination/Pagination-test.js index d5c44c7942c1..ac57c387ca1b 100644 --- a/src/components/Pagination/Pagination-test.js +++ b/src/components/Pagination/Pagination-test.js @@ -353,6 +353,29 @@ describe('Pagination', () => { ); expect(right.length).toEqual(0); }); + + it('should not append `pagination__button--no-index` class if input is disabled', () => { + const pagination = shallow( + + ); + const forwardButton = pagination.find( + '.bx--pagination__button--forward' + ); + const backwardButton = pagination.find( + '.bx--pagination__button--backward' + ); + expect( + backwardButton.hasClass('bx--pagination__button--no-index') + ).toEqual(false); + expect( + forwardButton.hasClass('bx--pagination__button--no-index') + ).toEqual(false); + }); }); describe('pagination navigation', () => { diff --git a/src/components/Pagination/Pagination.js b/src/components/Pagination/Pagination.js index 2f5da275df03..25ff10aa9388 100644 --- a/src/components/Pagination/Pagination.js +++ b/src/components/Pagination/Pagination.js @@ -260,8 +260,7 @@ export default class Pagination extends Component { `${prefix}--pagination__button`, `${prefix}--pagination__button--backward`, { - [`${prefix}--pagination__button--no-index`]: - pageInputDisabled || backButtonDisabled, + [`${prefix}--pagination__button--no-index`]: backButtonDisabled, } ); const forwardButtonDisabled = @@ -270,8 +269,7 @@ export default class Pagination extends Component { `${prefix}--pagination__button`, `${prefix}--pagination__button--forward`, { - [`${prefix}--pagination__button--no-index`]: - pageInputDisabled || forwardButtonDisabled, + [`${prefix}--pagination__button--no-index`]: forwardButtonDisabled, } ); const selectItems = this.renderSelectItems(totalPages);