From 0e7113842337ecb185206d3c9a224fd6bb7d7229 Mon Sep 17 00:00:00 2001 From: Affan Ahmad Date: Sun, 28 Mar 2021 00:28:47 +0000 Subject: [PATCH] adding callback on clear --- src/core/Typeahead.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/Typeahead.js b/src/core/Typeahead.js index a506469e..af447ef6 100644 --- a/src/core/Typeahead.js +++ b/src/core/Typeahead.js @@ -261,6 +261,9 @@ export function getInitialState(props: Props): TypeaheadState { } export function clearTypeahead(state: TypeaheadState, props: Props) { + if (typeof props.onInputChange === "function") { + props.onInputChange(""); + } return { ...getInitialState(props), isFocused: state.isFocused,