What you were expecting:
If a input validation on a filter (throught the "validate" attribute) fails, no fetch should happen, and the field should assume a error state.
What happened instead:
A fetch to server, cleaning the error state of the input.
Steps to reproduce:
Environment
Can you elaborate on the need for validation in an input form?
By the way, I'm rephrasing your issue to show it's an enhancement request.
Hi. I also think that validation would be helpful. Maybe you expect input which can be only positive integer? (If you write negative or zero - server returns 400 with error message).
In my case record has collection of things. The thing can be one of many types.
My filter is collection where 1 item of the collection is 2 filter fields:
Both type and count has to be non empty and count has to be > 0 (you can't have -2 of the thing).
I would also mention that it was hassle to create such filter - as by default it's easy to create filter only with one field (https://github.com/marmelab/admin-on-rest/issues/817) so I had to create one more hidden field, make sure that other fields has empty model value (so they're ignored by reduxForm), all fields are synchronized with the hidden field...
Hi, fzaninotto!
I think i have been misunderstood and I sorry for that.
I have no problem making a input control validate, it works well. The issue is when the input control is in a filter form of a resource. In this situation, even if the validation fails, the fetch is made, thus refreshing the screen and cleaning the invalid state of the input. The error "flashes" bellow the input control. The resource ignores the invalid state of the control and always filter.
In my case, what I need in my project is to avoid a date range with final date earlier than start date.
Just to reinforce, is "input control", not "input form".
That said, I think the former title better suits the case.
Thank you all.
Does anyone have some news on this?
I'm not sure this is an enhancement as much as something that's required. Anytime you're taking input from the user you should have some sort of validation for it. Even if it's a filter. However, maybe the workaround is just displaying a "no results found" instead of throwing a 400 code and quitting out the view.
Hi, guys.
Just to refresh the original problem: validation on filter fields works,
but any error messages that the validation produces disappears
automatically right after it was shown.
Em sex, 12 de jan de 2018 23:57, Alexander L. Rivera <
[email protected]> escreveu:
I'm not sure this is an enhancement as much as something that's required.
Anytime you're taking input from the user you should have some sort of
validation for it. Even if it's a filter. However, maybe the workaround is
just displaying a "no results found" instead of throwing a 400 code and
quitting out the view.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/marmelab/admin-on-rest/issues/1207#issuecomment-357401114,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFY9qQasRxi0m7QQv-3EO6TrfbkJ8Gkhks5tKA2kgaJpZM4QTwMr
.
Greetings. Any news on this? Or is there some kind of a workaround?
By the way, I would be happy to close this issue as it's very old, and as currently, I can't see the problem anymore in last version.
I don't really see what's still wrong.
@yuriydobryanskyyempeek Maybe you have more specific questions about it.

No, It works for awhile already. Thanks
Nice, thanks.
It's kinda strange for me that a invalid filter triggers a fetch on the api. For sure, a good api would be prepared for invalid input data, but then it would respond with an apropriate status, that's not 200. And, in my opinion, erros responses should not be masked.
Anyway, I'm not using React-Admin anymore (new job). Maybe someday I ask you to reopen this! ;)
Thanks.
Most helpful comment
Hi. I also think that validation would be helpful. Maybe you expect input which can be only positive integer? (If you write negative or zero - server returns 400 with error message).
In my case record has collection of things. The thing can be one of many types.
My filter is collection where 1 item of the collection is 2 filter fields:
Both
typeandcounthas to be non empty andcounthas to be > 0 (you can't have -2 of the thing).I would also mention that it was hassle to create such filter - as by default it's easy to create filter only with one field (https://github.com/marmelab/admin-on-rest/issues/817) so I had to create one more hidden field, make sure that other fields has empty model value (so they're ignored by reduxForm), all fields are synchronized with the hidden field...