From f13fd1d7ed45cbfb66727f8ccabc6a843f11cacc Mon Sep 17 00:00:00 2001 From: Vincent Robert Date: Wed, 7 Jun 2017 17:43:01 +0200 Subject: [PATCH] Allow default action if there is no selected result --- src/modules/Search/Search.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/Search/Search.js b/src/modules/Search/Search.js index 7be1300e70..be611f9071 100644 --- a/src/modules/Search/Search.js +++ b/src/modules/Search/Search.js @@ -317,13 +317,14 @@ export default class Search extends Component { debug('selectItemOnEnter()') debug(keyboardKey.getName(e)) if (keyboardKey.getCode(e) !== keyboardKey.Enter) return - e.preventDefault() const result = this.getSelectedResult() // prevent selecting null if there was no selected item value if (!result) return + e.preventDefault() + // notify the onResultSelect prop that the user is trying to change value this.setValue(result.title) this.handleResultSelect(e, result)