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

div in NestField leads to an infinite loop #62

Closed
RSchwan opened this issue Jul 5, 2016 · 9 comments
Closed

div in NestField leads to an infinite loop #62

RSchwan opened this issue Jul 5, 2016 · 9 comments
Assignees
Labels
Type: Bug Bug reports and their fixes

Comments

@RSchwan
Copy link
Contributor

RSchwan commented Jul 5, 2016

I have following form:

<AutoForm schema={schema} onSubmit={doc => console.log(doc)}>
  <AutoField name="title" />
  <div className="two fields">
    <AutoField name="field1" />
    <AutoField name="field2" />
  </div>
  <ListField name="courses">
    <ListItemField name="$">
      <NestField>
        <AutoField name="title" />
        <AutoField name="description" />
        <div className="three fields">
          <AutoField name="min" />
          <AutoField name="max" />
          <AutoField name="max2" />
        </div>
      </NestField>
    </ListItemField>
  </ListField>
  <ErrorsField />
</AutoForm>

This code leads to an infinite loop and the browser freezes. If I replace

<div className="three fields">
  <AutoField name="min" />
  <AutoField name="max" />
  <AutoField name="max2" />
</div>

with

<AutoField name="min" />
<AutoField name="max" />
<AutoField name="max2" />

the browser doesn't freeze.

@RSchwan
Copy link
Contributor Author

RSchwan commented Jul 5, 2016

The browser also freezes if there is an HiddenField in NestField

@radekmie radekmie added the Type: Bug Bug reports and their fixes label Jul 5, 2016
@radekmie radekmie self-assigned this Jul 5, 2016
@radekmie
Copy link
Contributor

radekmie commented Jul 5, 2016

That's a really interesting bug. I'll try to investigate it.

@radekmie
Copy link
Contributor

radekmie commented Jul 5, 2016

What browser are you using? I've tried, but my browser has never frozen, but Uncaught Error: Field not found in schema: 'min' appeared. It's still a bug of course.

@RSchwan
Copy link
Contributor Author

RSchwan commented Jul 5, 2016

Chrome on a mac

@radekmie
Copy link
Contributor

radekmie commented Jul 5, 2016

Which version?

@RSchwan
Copy link
Contributor Author

RSchwan commented Jul 5, 2016

51

@radekmie
Copy link
Contributor

radekmie commented Jul 5, 2016

That's even more interesting - I'm on 53 and it's a completely different error. Okay, I'll try to fix it.

@radekmie
Copy link
Contributor

radekmie commented Jul 5, 2016

Okay, I've got rid of this (at least in latest chrome). Please, check if it works for you.

@RSchwan
Copy link
Contributor Author

RSchwan commented Jul 6, 2016

Perfect! Works 👍

@Monteth Monteth added this to Closed in Open Source (migrated) Jul 7, 2021
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

No branches or pull requests

2 participants