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

Rating not being enabled on change from disabled=true to disabled=false #428

Closed
CTrando opened this issue Jun 1, 2018 · 1 comment
Closed
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@CTrando
Copy link

CTrando commented Jun 1, 2018

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
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

Plunkr Case (Bug Reports)
Please fork the plunkr below and create a case demonstrating your bug report. Issues without a plunkr have much less possibility to be reviewed.

https://plnkr.co/edit/C6qjkdLtbmy92Hogdnjb?p=preview

Current behavior
The bug involves the Rating component. It only listens for changes in the value before rerendering; however, when you change the disabled prop outside, because of the shouldComponentUpdate lifecycle hook, if disabled is changed the component does not rerender and have the component be enabled.

Expected behavior
If we set the disabled prop of Rating to false after it has been true, the Rating component will be enabled.

Minimal reproduction of the problem with instructions
Make a boolean in state - stateBoolean = true. Have the Rating component's prop disabled = stateBoolean. Change stateBoolean to false.

Sorry I am pretty new to this all, but I think this is it.
https://plnkr.co/edit/NLUeDJSSGSSufYQKQsrA?p=preview

Please tell us about your environment:
Windows 10, PyCharm

  • React version:
    React 16.4

  • PrimeReact version:
    1.5.3

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
    Chrome, firefox, safari, edge.

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    ES6

Should be an easy fix - compare this.props.disabled === nextProps.disabled. Thanks for the library it has been a great help to me.

@mertsincan mertsincan self-assigned this Jun 1, 2018
@mertsincan mertsincan added the Type: Bug Issue contains a defect related to a specific component. label Jun 1, 2018
@mertsincan mertsincan added this to the 1.6.0 milestone Jun 1, 2018
@mertsincan
Copy link
Member

mertsincan commented Jun 1, 2018

Should be an easy fix - compare this.props.disabled === nextProps.disabled.

Thanks a lot for your suggestion! Fixed now.

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