question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: Pagination shows redundant information when `pagesUnknown` is set to true.

See original GitHub issue

Package

@carbon/react, carbon-components-react

Browser

Chrome, Firefox, Edge

Package version

v1.14

Description

In pagination component, when pagesUnknown prop has been set to true, the page number is shown twice.

e.g. 1 page 1 If I change the page number via select, the page number also updates as such: 2 page 2 3 page 3 …etc,

The first number is the page option selected from the select element. Then the same information is repeated in the following text. Shouldn’t it just be Page <select element with number> [TEXT (SELECT ELEMENT)]? Is there a reason for repeating the page number?

I’m not sure if this counts as a design defect, but this issue was raised in Carbon Angular, just forwarding it here so we know what steps to take.

Screenshots

image image image

Steps to reproduce

Go to the following storybook (props have been already set, so no changes required):

https://react.carbondesignsystem.com/?path=/story/components-pagination--default&args=pagesUnknown:true

Code of Conduct

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
tw15egancommented, Oct 14, 2022

@61130061 I believe we already have a hidden label for the select, so I’d just keep it a span to avoid redundant screenreader text.

Your examples look great 👍🏻

1reaction
tw15egancommented, Oct 14, 2022

Also posted in #12302

I think this can be fixed just by passing down pageText={() => ''} to the Pagination component as-is. It seems like there is a slight styling issue in this scenario, but can be fixed by just adding the following CSS to _pagination.scss

.#{$prefix}--pagination__right .#{$prefix}--pagination__text:empty {
    margin: 0;
}
Screen Shot 2022-10-14 at 10 26 38 AM
Read more comments on GitHub >

github_iconTop Results From Across the Web

redundant pagination numbers · Issue #3746 · pkp ... - GitHub
When the query results items number (on the search page) goes beyond 1 page, there are redundant pagination numbers. OJS 3.1.1.
Read more >
There's a bug with Search and Pagination in React
When I search for something on the site, it only works when after that I go to another page. I think this is...
Read more >
A simple guide to Pagination in React | by Kunal Nalawade
Until then the loading state is set to true which allows us to display a Loading message on the screen until the data...
Read more >
Pagination - Bootstrap
Documentation and examples for showing pagination to indicate a series of related content exists across multiple pages.
Read more >
Row Pagination - React Data Grid
This can be achieved by customising localisation, for more info see ... If you set paginationAutoPageSize=true the grid will automatically show as many...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found