From bbc42ae87ff5f91e4510584d4e78a48ec8860138 Mon Sep 17 00:00:00 2001 From: Amir Hadzic Date: Wed, 2 Nov 2016 09:42:44 +0100 Subject: [PATCH] [#3] Fix text filter menu entry not being shown --- src/Filter.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Filter.js b/src/Filter.js index d7d0815..9225946 100644 --- a/src/Filter.js +++ b/src/Filter.js @@ -10,6 +10,14 @@ const propTypes = { }; class Filter extends Component { + shouldComponentUpdate(nextProps) { + const { value, options } = this.props; + if (nextProps.value !== value || nextProps.options !== options) { + return true; + } + return false; + } + render() { const { value, @@ -24,7 +32,10 @@ class Filter extends Component { placeholder="Search by text or tags" promptTextCreator={(txt) => `Search for '${txt}'`} onChange={(selected) => onChange(selected)} - onInputChange={(text) => onTextChange(text)} + onInputChange={(text) => { + onTextChange(text); + return text; + }} onBlurResetsInput={false} onCloseResetsInput={false} newOptionCreator={({ label }) => createTextFilter(label)}