Skip to content

Commit

Permalink
fix(Pagination): keep page input Select visible (carbon-design-system…
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod authored Feb 28, 2020
1 parent 8379ffc commit 2c456d2
Showing 1 changed file with 16 additions and 25 deletions.
41 changes: 16 additions & 25 deletions packages/react/src/components/Pagination/Pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,18 +261,6 @@ export default class Pagination extends Component {
}
);
const selectItems = this.renderSelectItems(totalPages);
const pageRange = (() => {
if (pageInputDisabled) {
return null;
}
return (
<span className={`${prefix}--pagination__text`}>
{pagesUnknown
? pageText(statePage)
: pageRangeText(statePage, totalPages)}
</span>
);
})();
return (
<div className={classNames} {...other}>
<div className={`${prefix}--pagination__left`}>
Expand Down Expand Up @@ -309,19 +297,22 @@ export default class Pagination extends Component {
</span>
</div>
<div className={`${prefix}--pagination__right`}>
{pageInputDisabled ? null : (
<Select
id={`${prefix}-pagination-select-${inputId}-right`}
className={`${prefix}--select__page-number`}
labelText={`Page number, of ${totalPages} pages`}
inline
hideLabel
onChange={this.handlePageInputChange}
value={statePage}>
{selectItems}
</Select>
)}
{pageRange}
<Select
id={`${prefix}-pagination-select-${inputId}-right`}
className={`${prefix}--select__page-number`}
labelText={`Page number, of ${totalPages} pages`}
inline
hideLabel
onChange={this.handlePageInputChange}
value={statePage}
disabled={pageInputDisabled}>
{selectItems}
</Select>
<span className={`${prefix}--pagination__text`}>
{pagesUnknown
? pageText(statePage)
: pageRangeText(statePage, totalPages)}
</span>
<button
type="button"
className={backButtonClasses}
Expand Down

0 comments on commit 2c456d2

Please sign in to comment.