adopted-ember-addons / adopted-ember-addons/ember-paper

paper-input: external validations messages is unusable for server side validation

Đang mở
#671 12 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
879
Fork
327
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I'm in a situation where I can't validate some form inputs client-side, I have to submit the form and the server may reject it with a `422` and errors for invalid inputs.

In this case I tried to pass those messages to the input using the `errors` property but I encountered the following issues:

- The input won't be displayed in error state until the user focus AND loose focus

- The errors won't be cleared when the user modify the value, leaving the feeling to the user that he did not fix the issue

The suggested solution for the first issue was to pass the `isTouched` attribute to true manually.

And I guess the solution for the second issue would be to have an external observer that reset the errors attribute when the value is updated.

But this is very cumbersome for a pattern that is pretty common I guess.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.