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

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

オープン
#671 コメント 12 件 リアクション 0 件 担当者 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 を短くまとめたダイジェスト。