fill-in doesn't work for array input names
Closed this issue · 4 comments
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?
That sounds like an oversight, I'll happily take a PR which has better behaviour in this case.
Sure, I'll try to get you something today!
Thanks @glenjamin!
Released in v0.8.0