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

[Field]resetToDefaults does not work with constructor values and parseName #953

Closed
jdkahn opened this issue Aug 2, 2019 · 1 comment
Closed
Assignees
Labels
Duplicate This issue or pull request already exists

Comments

@jdkahn
Copy link
Contributor

jdkahn commented Aug 2, 2019

Component

Field

Reproduction link

https://riddle.alibaba-inc.com/riddles/bea0910

Steps to reproduce

  • Click Reset
  • Click ResetToDefaults
    Expect: ObjectWithDefaults should be set back to its values passed into the constructor
    Actual: ObjectWithDefaults does not change

Cause:
field.init is called on each render and resets the field.initValue field. On resetToDefaults it uses this field.initValue field as the default value

@bindoon
Copy link
Member

bindoon commented Aug 13, 2019

same with #1001

@bindoon bindoon closed this as completed Aug 13, 2019
@bindoon bindoon added the Duplicate This issue or pull request already exists label Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants