Skip to content

Commit 4d89526

Browse files
committed
Properly add novalidate to forms
1 parent a23c3b9 commit 4d89526

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

addon/components/validatable-form.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ export default Ember.Component.extend({
1414
/**
1515
* Prevent the built-in browser navigation error messages to pop up
1616
*
17-
* @type {boolean}
17+
* @type {string}
1818
*/
19-
novalidate: true,
19+
novalidate: 'novalidate',
2020

2121
/**
2222
* Optional Ember-Data model from where to fetch server-side errors

addon/mixins/validatable-input.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ export default Ember.Mixin.create({
7979
* @returns {void}
8080
*/
8181
attachValidationListener: function() {
82-
Ember.$(this.get('element')).on('invalid', Ember.run.bind(this, this.validate));
82+
Ember.$(this.get('element')).on('invalid focusout', Ember.run.bind(this, this.validate));
8383
}.on('didInsertElement'),
8484

8585
/**
8686
* @returns {void}
8787
*/
8888
detachValidationListener: function() {
89-
Ember.$(this.get('element')).off('invalid');
89+
Ember.$(this.get('element')).off('invalid focusout');
9090
}.on('willDestroyElement'),
9191

9292
/**
@@ -108,7 +108,7 @@ export default Ember.Mixin.create({
108108
this.set('errorMessage', null);
109109
input.setCustomValidity('');
110110
}
111-
}.on('focusOut'),
111+
},
112112

113113
/**
114114
* Set a custom error message for the input. Note that we set the error message directly, as well as we

0 commit comments

Comments
 (0)