diff --git a/src/components/assistants/generic/value-assistant.jsx b/src/components/assistants/generic/value-assistant.jsx index a50400f..85d4e00 100644 --- a/src/components/assistants/generic/value-assistant.jsx +++ b/src/components/assistants/generic/value-assistant.jsx @@ -50,8 +50,12 @@ export class ValueAssistant extends Assistant { @Bind onTypedTextChanged (newText) { this.setState({ + activeSuggestion: -1, typedText: newText }); + if (this.machineState) { + this.machineState.previewValue = null; + } } @Bind diff --git a/src/components/builders/generic/value-builder.jsx b/src/components/builders/generic/value-builder.jsx index 47b36f0..94269b6 100644 --- a/src/components/builders/generic/value-builder.jsx +++ b/src/components/builders/generic/value-builder.jsx @@ -108,12 +108,15 @@ export class ValueBuilder extends Builder { } @Bind - @Debounce(250) // 250ms debounce handleKeyUp (e) { + this.machineState.typedText = e.target.value; // inform state of typed text + this.getSuggestions(e); + } + + @Debounce(250) + getSuggestions (e) { const boxed = this.machine.boxedValue; this.machineState.fetchSuggestions(this.machineState.unformatUnboxedValue(e.target.value, boxed), boxed, e.target.value); - // inform state of typed text - this.machineState.typedText = e.target.value; } focus () {