feat(Pagination): add Pagination component#108
feat(Pagination): add Pagination component#108eddywashere merged 1 commit intoreactstrap:masterfrom mking-clari:pagination
Conversation
| ); | ||
|
|
||
| return ( | ||
| <Tag {...attributes} className={classes}> |
There was a problem hiding this comment.
Can you add the aria label, the aria hidden attr and sr-only label for accessibility?
<a class="page-link" href="#" aria-label="Next">
<span aria-hidden="true">»</span>
<span class="sr-only">Next</span>
</a>
There was a problem hiding this comment.
For prev/next, I don't think it will ever require children unless someone wants to override the carets. Could you setup rendering to be: if prev/next, include spans and render children instead of carets vs rendering children before the prev/next content.
|
A few comments, let me know what you think. Great work! |
|
@eddywashere Thanks for the feedback, I updated the code. Some notes:
|
|
|
||
| let defaultCaret; | ||
| if (previous) { | ||
| defaultCaret = <span>«</span>; |
There was a problem hiding this comment.
I don't think these extra spans are needed anymore since it's taken care of with <span aria-hidden="true">{children || defaultCaret}</span>.
There was a problem hiding this comment.
I don't remember if « as a string will render html, might need html entity.
|
@eddywashere For the For the span issue, I added an array (keys required to avoid warning). |
|
👍 |
References #77
Pagination,PaginationItem,PaginationLinkPaginationsupports sizingPaginationItemsupports active and disabled statesPaginationLinksupports special rendering for next and previous links