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

Can conditions run on individual objects in an array? #22

Closed
mrclay opened this issue Mar 3, 2018 · 3 comments
Closed

Can conditions run on individual objects in an array? #22

mrclay opened this issue Mar 3, 2018 · 3 comments

Comments

@mrclay
Copy link
Contributor

mrclay commented Mar 3, 2018

We have an array of objects, and need conditions to apply based on fields in the same array element. Something like:

{
  conditions: {
    'arr[x].foo': { equal: true }},
  },
  event: {
    type: 'remove',
    params: { field: 'arr[x].bar' }
  }
};
@mrclay
Copy link
Contributor Author

mrclay commented Mar 5, 2018

I think we'll have to process rules separately for each object in formData. We're already using a separate Form element to handle conditionals within the array object.

mavarazy added a commit that referenced this issue Mar 8, 2018
@mavarazy
Copy link
Contributor

mavarazy commented Mar 8, 2018

@mrclay for internal selection selectn library is used, so as long is you have a specific index in the array, there is no problem with rulesEngine, but I suspect there will be a problem with react-jsonschema-form-conditionals project, I'll check. Refer to the test that I submitted.

@mavarazy mavarazy closed this as completed Mar 8, 2018
@mavarazy
Copy link
Contributor

mavarazy commented Mar 8, 2018

Here is a test for removing element from an array in conditionals project
RXNT/react-jsonschema-form-conditionals@4667979

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

2 participants