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

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

未關閉
#671 12 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
879
分支
327
PR 合併指標
30 天內沒有已合併 PR

描述

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.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。