From 55da32f53dc6d7c209ccda2947bd6ae084364934 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 3 Aug 2016 19:41:51 -0700 Subject: [PATCH] Fixed auth and key/value editor being weird --- app/components/base/KeyValueEditor.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/components/base/KeyValueEditor.js b/app/components/base/KeyValueEditor.js index 3862b7cf26..db788f3dd5 100644 --- a/app/components/base/KeyValueEditor.js +++ b/app/components/base/KeyValueEditor.js @@ -23,11 +23,10 @@ class KeyValueEditor extends Component { } } - _onChange (pairs, debounce = false) { + _onChange (pairs) { clearTimeout(this._timeout); - this._timeout = setTimeout(() => { - this.props.onChange(pairs); - }, debounce ? DEBOUNCE_MILLIS : 0); + this._timeout = setTimeout(() => this.props.onChange(pairs), DEBOUNCE_MILLIS); + this.setState({pairs}); } _addPair (position) { @@ -53,7 +52,7 @@ class KeyValueEditor extends Component { const pairs = this.state.pairs.map( (p, i) => i == position ? Object.assign({}, p, pairPatch) : p ); - this._onChange(pairs, true); + this._onChange(pairs); } _focusNext (addIfValue = false) { @@ -149,7 +148,7 @@ class KeyValueEditor extends Component { const {maxPairs, className, valueInputType} = this.props; return ( -