Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paginator - Uncaught TypeError: this.getOptionLabel(...).toLowerCase is not a function #739

Closed
ajlai-duetto opened this issue Jan 11, 2019 · 0 comments
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@ajlai-duetto
Copy link

There is no guarantee in receiving an immediate response in GitHub Issue Tracker, If you'd like to secure our response, you may consider PrimeReact PRO Support where support is provided within 4 business hours

I'm submitting a ... (check one with "x")

[ x ] bug report
[ ] feature request

Plunkr Case (Bug Reports)
This is actually happening in the demos
https://www.primefaces.org/primereact/#/paginator
and
https://www.primefaces.org/primereact/#/datatable/paginator
Current version is PrimeReact 3.0.0-beta.1 in the demo but it happens on 3.0.0-rc.1 as well

Current behavior
Changing the number of rows per page in paginator and switching browser tabs shows error in console:
Uncaught TypeError: this.getOptionLabel(...).toLowerCase is not a function

Which is happening in

  searchOptionInRange(start, end) {
        for (let i = start; i < end; i++) {
            let opt = this.props.options[i];
            let label = this.getOptionLabel(opt).toLowerCase();
            if (label.startsWith(this.searchValue.toLowerCase())) {
                return opt;
            }
        }

        return null;
    }

Expected behavior
No console error

Minimal reproduction of the problem with instructions
Steps to Reproduce:
1 ) Change the rows per page from 10 to something else in the paginator.
2) Open a new tab in the browser or switch to a different tab and then go back to the tab with the paginator
3) Functionality still works but in the console it shows an error:
Uncaught TypeError: this.getOptionLabel(...).toLowerCase is not a function

Please tell us about your environment:
MacOS

  • React version:
    16.6.0

  • PrimeReact version:
    3.0.0-rc.1

  • Browser:
    Web browser: Chrome Version 71.0.3578.98 (Official Build) (64-bit)

  • Language:
    ES6

@cagataycivici cagataycivici self-assigned this Jan 22, 2019
@cagataycivici cagataycivici added the Type: Bug Issue contains a defect related to a specific component. label Jan 22, 2019
@cagataycivici cagataycivici added this to the 3.0.0-Final milestone Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

2 participants