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

Using "maxlength" of Spinner causes errors #787

Closed
partynikko opened this issue Feb 22, 2019 · 1 comment
Closed

Using "maxlength" of Spinner causes errors #787

partynikko opened this issue Feb 22, 2019 · 1 comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@partynikko
Copy link
Contributor

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

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

Plunkr Case (Bug Reports)
https://plnkr.co/edit/ffyN77iR3t3j4utIGfGh?p=preview

Current behavior
Specifying the prop maxlength of <Spinner /> will cause errors/crashes.

Expected behavior
Expected component not to crash and to update its value.

Minimal reproduction of the problem with instructions
Specify the maxlength prop of <Spinner /> and the component will no longer work.
The issue is happening because of the following line of code:

if (this.props.maxlength !== null && this.value.toString().length > this.props.maxlength) {

this.value.toString() should be replaced by this.props.value.toString().
See the console ouput in Plunkr: https://plnkr.co/edit/ffyN77iR3t3j4utIGfGh?p=preview

  • React version:
    16.8.2

  • PrimeReact version:
    3.1.0

  • Browser:
    all

  • Language:
    all

@mertsincan
Copy link
Member

Thanks a lot for the PR!

@mertsincan mertsincan added the Type: Bug Issue contains a defect related to a specific component. label Feb 28, 2019
@mertsincan mertsincan added this to the 3.1.1 milestone Feb 28, 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