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

updating labels in schema does not update labels in component #76

Closed
macrozone opened this issue Jul 20, 2016 · 2 comments · Fixed by #77
Closed

updating labels in schema does not update labels in component #76

macrozone opened this issue Jul 20, 2016 · 2 comments · Fixed by #77
Assignees
Labels
Type: Bug Bug reports and their fixes

Comments

@macrozone
Copy link
Contributor

I create a SimpleSchema-instance on the fly in a container, where i declare labels (with translations).

However, this will not update the labels of the form-fields.

I tried to debug this and i found out that it properly sets the new bridge/scheme for the child-context, but the children seem not to pickup this new context.

Any idea? React bug?

@macrozone
Copy link
Contributor Author

Ok, in BaseField shouldComponentUpdate is implemented, which does trigger on schema update, but it's implementation does not check whether the schema/bridge changed.

Can we shallow-compare the schemes? In my scenario, even a simple

if(nextContext.schema !== prevContext.schema){
    return true;
}

would fix the issue. Will create a PR for that.

macrozone added a commit to macrozone/uniforms that referenced this issue Jul 20, 2016
@radekmie radekmie added the Type: Bug Bug reports and their fixes label Jul 20, 2016
@radekmie radekmie self-assigned this Jul 20, 2016
@radekmie
Copy link
Contributor

Thanks PR, @macrozone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bug reports and their fixes
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants