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

Input fields created with repeat.for in DOM not working with Aurelia Validation #408

Closed
kvadd opened this issue Jan 24, 2017 · 2 comments
Closed
Assignees
Labels

Comments

@kvadd
Copy link

kvadd commented Jan 24, 2017

First of all, I want to thank you guys for an amazing framework! We use it for all our new projects for it's ease of use and primary your dedication to keeping standards.

However, I think I have hit a bug with Aurelia Validation plugin when repeat.for is responsible for rendering input fields that require validation.

I'm submitting a bug report

  • Library Version:
    1.0.8

Please tell us about your environment:

  • Operating System:
    Windows 10

  • Node Version:
    6.2.1

  • NPM Version:
    3.9.5

  • JSPM OR Webpack AND Version
    JSPM 0.16.34

  • Browser:
    all

  • Language:
    TypeScript 2.0.3

Current behavior:
Input fields that are created under a repeat.for in the DOM are not detected as validated fields.

Expected/desired behavior:
Repeated input fields should be included in the binded value 'validate'

https://gist.run/?id=d21cdf00e9a3fd30c50c72f4a4b4df98

  • What is the expected behavior?
    Repeated input fields should have the ability to be validated.

  • What is the motivation / use case for changing the behavior?
    For example: For dynamic created forms, when getting form information from another source.

@dkent600
Copy link
Contributor

dkent600 commented Jan 24, 2017

If you change this line in the gist:

<div class="form-group" repeat.for="field of fields">

to this:

<div class="form-group" repeat.for="field of fields" with.bind="$parent">

then the validation works.

Just sayin'. I'm not sure if this should be necessary or not.

@dkent600
Copy link
Contributor

dkent600 commented Jan 24, 2017

It seems odd that the code change I described above would be required because without it is perfectly possible to bind to the fields in $parent. It is just the validation code that is having the problem.

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

No branches or pull requests

4 participants