New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h5.ui.FormController グループ内のinput要素にルールを設定すると、keyup/blur時にバルーンが消えなくなる #553

Closed
mtakeuchi opened this Issue Apr 6, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@mtakeuchi
Contributor

mtakeuchi commented Apr 6, 2016

data-h5-input-group-containerを指定した要素内にあるinputに対してルールを設定すると、
値を入力したりフォーカスを外しても、バルーンのバリデーションメッセージが消えなくなってしまいます。

以下サンプルコード。

[HTML]

<div data-h5-input-group-container="fullname" style="width:320px">
  <input type="text" name="lastname" placeholder=""><br>
  <input type="text" name="firstname" placeholder="">
</div>
<input type="button" value="確認" id="btn1">

[JavaScript]

  h5.core.controller('body', {
    formController: h5.ui.FormController,
    __meta: {
      formController: {
        rootElement: '#form1'
      }
    },
    __name: 'PageController',
    __ready: function() {
      this.formController.addOutput('bsBalloon');
      this.formController.setSetting({
        output: {
          bsBalloon: {
            placement: 'right'
          }
        },
        property: {
          fullname: {
            displayName: '姓名',
            message: '{displayName}は両方とも入力して下さい。'
          },
          lastname: {
            displayName: '',
            message: '{displayName}は必須です'
          }
        }
      });

      this.formController.addRule({
        lastname: {
          required: true
        },
        fullname: {
          customFunc: function(group) {
            var firstname = group.firstname;
            var lastname = group.lastname;
            return (firstname && lastname);
          }
        }
      });
    },
    '#btn1 click': function() {
      this.formController.validate();
    }
  });

表示結果
result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment