From 539a04191ad6a8b74a433de6ef755ed6be37ee56 Mon Sep 17 00:00:00 2001 From: "James A. Rosen" Date: Sat, 27 Jun 2015 17:30:29 -0700 Subject: [PATCH] x-select: use change() to handle changes from DOM Ember views automatically call `.change()` on DOM change events, so we can use that hook instead of adding a change handler in `didInsertElement` and tearing it down in `willDestroyElement`. This is now the only place we need to call `_updateValueSingle` or `_updateValueMultiple`. We don't need to do that when the content changes from upstream since (in Glimmer) the component will render the difference automatically. Calling those in an observer on `content.@each` was causing upstream writes to happen unnecessarily. --- addon/components/x-select.js | 42 ++++++------------------------------ 1 file changed, 6 insertions(+), 36 deletions(-) diff --git a/addon/components/x-select.js b/addon/components/x-select.js index 6b030f1..9754d91 100644 --- a/addon/components/x-select.js +++ b/addon/components/x-select.js @@ -130,36 +130,18 @@ export default Ember.Component.extend({ }), /** - * Listen for change events on the native