From 6ac4d42d28bcaf888e186dfd8795d4fb5956ced3 Mon Sep 17 00:00:00 2001 From: Jeremy Danyow Date: Tue, 5 Jan 2016 21:54:38 -0500 Subject: [PATCH] fix(ValueAttributeObserver): notify only when changing element value fixes aurelia/framework#288 --- src/element-observation.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/element-observation.js b/src/element-observation.js index d4843c19..52a5a082 100644 --- a/src/element-observation.js +++ b/src/element-observation.js @@ -97,10 +97,11 @@ export class ValueAttributeObserver { } setValue(newValue) { - this.element[this.propertyName] = - (newValue === undefined || newValue === null) ? '' : newValue; - - this.notify(); + newValue = newValue === undefined || newValue === null ? '' : newValue; + if (this.element[this.propertyName] !== newValue) { + this.element[this.propertyName] = newValue; + this.notify(); + } } notify() {