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

Error in JSBin Remove property on hide #106

Open
blowsie opened this issue Jun 24, 2016 · 1 comment
Open

Error in JSBin Remove property on hide #106

blowsie opened this issue Jun 24, 2016 · 1 comment

Comments

@blowsie
Copy link

blowsie commented Jun 24, 2016

There is a bug in this JS Bin;
http://jsbin.com/sufate/edit?js,output

An infinite recursion error is caused by line 18.

This is the function:

    function removeOnHideTransformer(fields) {
      return fields.map(function(field) {
        field.data = field.data || {};
        if (field.key && !field.noFormControl && field.hideExpression && !field.data.dontRemoveOnHidden) {
          addFieldRemoveOnHideWatcher(field);
        } else if (field.fieldGroup) {
          field.fieldGroup = removeOnHideTransformer(fields);
        }
        return field;
      });
    }

This code

 else if (field.fieldGroup) {
          field.fieldGroup = removeOnHideTransformer(fields);
        }

Should be

 else if (field.fieldGroup) {
          field.fieldGroup = removeOnHideTransformer(field.fieldGroup);
        }
@blowsie
Copy link
Author

blowsie commented Jun 24, 2016

I can create a PR with a new JS Bin Id if required, but It might be easier to just update the existing example.

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