From ca19030081d8039d5f6b25ca399caa029dd2afc7 Mon Sep 17 00:00:00 2001 From: Jeff Nusz Date: Thu, 18 Aug 2016 14:54:52 -0700 Subject: [PATCH] Allow updates to OptionController while listening. fix #101 --- src/dat/controllers/NumberControllerBox.js | 2 +- src/dat/controllers/OptionController.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dat/controllers/NumberControllerBox.js b/src/dat/controllers/NumberControllerBox.js index 044300a..9bc1d78 100644 --- a/src/dat/controllers/NumberControllerBox.js +++ b/src/dat/controllers/NumberControllerBox.js @@ -107,7 +107,7 @@ class NumberControllerBox extends NumberController { } updateDisplay() { - if (dom.isActive(this.__input)) return null; // prevent number from update if user is trying to manually update + if (dom.isActive(this.__input)) return this; // prevent number from updating if user is trying to manually update this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision); return super.updateDisplay(); } diff --git a/src/dat/controllers/OptionController.js b/src/dat/controllers/OptionController.js index 60ce434..9042061 100644 --- a/src/dat/controllers/OptionController.js +++ b/src/dat/controllers/OptionController.js @@ -78,6 +78,7 @@ class OptionController extends Controller { } updateDisplay() { + if (dom.isActive(this.__select)) return this; // prevent number from updating if user is trying to manually update this.__select.value = this.getValue(); return super.updateDisplay(); }