piceaTech/ember-rapid-forms

Can't create multiple forms for same model type on latest master

Closed this issue · 3 comments

I tried out the latest version of master (commit afca35e), since I wanted the prompt fix, but I found a problem.

I have the following code:

{{#each sortedOptions as |option index|}}
  {{#em-form action='formSubmitted' formLayout='horizontal' model=option submitButton=false}}
    {{em-input type='text' property='option_text' label=(t 'functions.concat' first='Option' second=option.order_index)}}
    {{em-checkbox property='preselected' label='Preselected' class='form-group inline-form-group'}}
  {{/em-form}}
{{/each}}

This results in error messages:
Uncaught Error: Assertion Failed: Attempted to register a view with an id already in use: option_text
Uncaught Error: Assertion Failed: Attempted to register a view with an id already in use: preselected

Seems like I can't loop over an array of the same model as it's not using unique IDs somewhere. This code works on 1.0.0-beta4.

I'm also getting deprecation warnings about modifying properties inside a didInsertElement hook coming from the latest code in master here too.

Doesn't complain if I set the cid's to something unique on the em-* inputs in the loop.

This seems like a bug, though.

@danconnell , you're right. I made this bug and I will find the solution to solve it.

It will be fixed by #89 once merged.