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

Bug with ordering of insertIf and object search create update #170

Open
SHA-4 opened this issue May 2, 2019 · 1 comment
Open

Bug with ordering of insertIf and object search create update #170

SHA-4 opened this issue May 2, 2019 · 1 comment

Comments

@SHA-4
Copy link
Contributor

SHA-4 commented May 2, 2019

Say I have the following in a fieldSet (this would not actually work but is meant to be an example):

[
  { field: 'person', createFields: [{ field: 'name' }], type: 'objectSearchCreate' },
  { field: 'nickname', insertIf: (model) => !!model.person.name },
]

The point of the insertIf is I only want to show the nickname field if the object search create is adding a new person and the name field of the createFields has a value in it.

However, when the back to search button is clicked, even though the insertIf should return false and the nickname field should disappear, it doesn't. When the model is logged in the insertIf, the name field value is still there. Thus, there seems to be an ordering problem with when the model is updated and when the insertIf functions are called

@SHA-4
Copy link
Contributor Author

SHA-4 commented Apr 13, 2020

I am facing this problem again. Another note: typing anything in the nickname field triggers the recalculation of the insertIf and makes the field disappear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant