Skip to content

Commit 4134ccd

Browse files
committed
remove onValidityChange call on component destroy
1 parent 0f79ea6 commit 4134ccd

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

addon/components/paper-input.js

-5
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ export default Component.extend(FocusableMixin, ColorMixin, ChildMixin, Validati
7777
this.growTextarea();
7878
},
7979

80-
willClearRender() {
81-
this._super(...arguments);
82-
this.sendAction('onValidityChange', false);
83-
},
84-
8580
willDestroyElement() {
8681
this._super(...arguments);
8782
if (this.get('textarea')) {

addon/components/paper-select.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,12 @@ export default PowerSelect.extend(ValidationMixin, ChildMixin, FocusableMixin, {
3434
attributeBindings: ['parentTabindex:tabindex'],
3535
shouldShowLabel: computed.and('label', 'selected'),
3636
focusedAndSelected: computed.and('focused', 'selected'),
37+
3738
didReceiveAttrs() {
3839
this._super(...arguments);
3940
this.notifyValidityChange();
4041
},
41-
willClearRender() {
42-
this.sendAction('onValidityChange', false);
43-
},
42+
4443
concatenatedTriggerClasses: computed('triggerClass', 'publicAPI.isActive', function() {
4544
let classes = ['ember-power-select-trigger'];
4645
if (this.get('isInvalid')) {

tests/integration/components/paper-form-test.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,7 @@ test('form `onSubmit` action is invoked', function(assert) {
6161
test('form `onValidityChange` action is invoked', function(assert) {
6262
// paper-input triggers `onValidityChange` on render
6363
// so we expect two runs: one on render and another on validity change
64-
65-
// on ember 2.4, it isn't running on destroy
66-
// check if we need to notify validity change on destroy
67-
// assert.expect(3);
64+
assert.expect(2);
6865

6966
this.set('onValidityChange', () => {
7067
assert.ok(true);

0 commit comments

Comments
 (0)