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

fill-in doesn't work for array input names #47

Closed
jbswetnam opened this issue Jun 5, 2016 · 4 comments
Closed

fill-in doesn't work for array input names #47

jbswetnam opened this issue Jun 5, 2016 · 4 comments

Comments

@jbswetnam
Copy link
Contributor

I have a form with multiple inputs sharing the name "members[]" so that their values will be collected into a vector when the form data is received by ring. I found that when I use fill-in to fill in one of those inputs (using a selector specific to that one), Kerodon was filling in all of the inputs, not just the one. This turned out to be because impl/field-to-selector matches by :name instead of using the more specific selector I had provided.

I can work around this by providing a unique id for each of the inputs (impl/field-to-selector checks for :id before going to :name). However, is there some reason why we can't match inputs with any arbitrary selector?

@glenjamin
Copy link
Collaborator

That sounds like an oversight, I'll happily take a PR which has better behaviour in this case.

@jbswetnam
Copy link
Contributor Author

Sure, I'll try to get you something today!

glenjamin added a commit that referenced this issue Jun 12, 2016
Use arbitrary selector in `fill-in` - Issue #47
@jbswetnam
Copy link
Contributor Author

Thanks @glenjamin!

@glenjamin
Copy link
Collaborator

Released in v0.8.0

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