Skip to content

Commit

Permalink
a11y rework of pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
Michail Yasonik committed Apr 10, 2020
1 parent 999502c commit d9d8fa3
Show file tree
Hide file tree
Showing 28 changed files with 890 additions and 479 deletions.
1 change: 1 addition & 0 deletions src-docs/src/views/pagination/centered_pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default function() {
<EuiFlexGroup justifyContent="spaceAround">
<EuiFlexItem grow={false}>
<EuiPagination
aria-label="Centered pagination example"
pageCount={PAGE_COUNT}
activePage={activePage}
onPageClick={activePage => goToPage(activePage)}
Expand Down
1 change: 1 addition & 0 deletions src-docs/src/views/pagination/customizable_pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export default () => {

<EuiFlexItem grow={false}>
<EuiPagination
aria-label="Custom pagination example"
pageCount={PAGE_COUNT}
activePage={activePage}
onPageClick={goToPage}
Expand Down
1 change: 1 addition & 0 deletions src-docs/src/views/pagination/few_pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default function() {

return (
<EuiPagination
aria-label="Few pages example"
pageCount={PAGE_COUNT}
activePage={activePage}
onPageClick={activePage => goToPage(activePage)}
Expand Down
1 change: 1 addition & 0 deletions src-docs/src/views/pagination/many_pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default function() {

return (
<EuiPagination
aria-label="Many pages example"
pageCount={PAGE_COUNT}
activePage={activePage}
onPageClick={activePage => goToPage(activePage)}
Expand Down
5 changes: 5 additions & 0 deletions src-docs/src/views/pagination/pagination_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import ManyPages from './many_pages';
const manyPagesSource = require('!!raw-loader!./many_pages');
const manyPagesHtml = renderToHtml(ManyPages);
const manyPagesSnippet = `<EuiPagination
aria-label="my pagination"
pageCount={higherThan5Number}
activePage={this.state.activePage}
onPageClick={this.goToPage}
Expand All @@ -25,6 +26,7 @@ import FewPages from './few_pages';
const fewPagesSource = require('!!raw-loader!./few_pages');
const fewPagesHtml = renderToHtml(FewPages);
const fewPagesSnippet = `<EuiPagination
aria-label="my pagination"
pageCount={lowerThan5Number}
activePage={this.state.activePage}
onPageClick={this.goToPage}
Expand All @@ -37,6 +39,7 @@ const centeredPaginationHtml = renderToHtml(CenteredPagination);
const centeredPaginationSnippet = `<EuiFlexGroup justifyContent="spaceAround">
<EuiFlexItem grow={false}>
<EuiPagination
aria-label="my pagination"
pageCount={pageCount}
activePage={this.state.activePage}
onPageClick={this.goToPage}
Expand All @@ -60,6 +63,7 @@ const customizablePaginationSnippet = `<EuiFlexGroup justifyContent="spaceBetwee
<EuiFlexItem grow={false}>
<EuiPagination
aria-label="my pagination"
pageCount={pageCount}
activePage={this.state.activePage}
onPageClick={this.goToPage}
Expand All @@ -72,6 +76,7 @@ import Compressed from './compressed';
const compressedSource = require('!!raw-loader!./compressed');
const compressedHtml = renderToHtml(Compressed);
const compressedSnippet = `<EuiPagination
aria-label="my pagination"
pageCount={pageCount}
activePage={this.state.activePage}
onPageClick={this.goToPage}
Expand Down
4 changes: 3 additions & 1 deletion src-docs/src/views/tables/custom/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ export default class extends Component {

render() {
let optionalActionButtons;
const exampleId = 'example-id';

if (this.areAnyRowsSelected() > 0) {
optionalActionButtons = (
Expand Down Expand Up @@ -718,7 +719,7 @@ export default class extends Component {
</EuiFlexGroup>
</EuiTableHeaderMobile>

<EuiTable>
<EuiTable id={exampleId}>
<EuiTableHeader>{this.renderHeaderCells()}</EuiTableHeader>

<EuiTableBody>{this.renderRows()}</EuiTableBody>
Expand All @@ -729,6 +730,7 @@ export default class extends Component {
<EuiSpacer size="m" />

<EuiTablePagination
controls={exampleId}
activePage={this.pager.getCurrentPageIndex()}
itemsPerPage={this.state.itemsPerPage}
itemsPerPageOptions={[5, 10, 20]}
Expand Down
Loading

0 comments on commit d9d8fa3

Please sign in to comment.