File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ const YourComponent = () => {
106106| debounceDelay | number | No | 200 | Delay before triggering search |
107107| showLoadingIndicator | boolean | No | true | Show/hide loading indicator |
108108| style | StyleProp | No | {} | Custom styles object |
109+ | onTextChange | (text: string) => void | No | - | Callback triggered on text input changes |
109110
110111## Methods
111112
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ const GooglePlacesTextInput = forwardRef(
8181 biasPrefixText,
8282 minCharsToFetch = 1 ,
8383 onPlaceSelect,
84+ onTextChange,
8485 debounceDelay = 200 ,
8586 showLoadingIndicator = true ,
8687 style = { } ,
@@ -172,7 +173,8 @@ const GooglePlacesTextInput = forwardRef(
172173
173174 const handleTextChange = ( text ) => {
174175 setInputText ( text ) ;
175- onPlaceSelect ( null ) ; // Notify parent when text changes
176+ onPlaceSelect ( null ) ;
177+ onTextChange ?. ( text ) ;
176178
177179 if ( debounceTimeout . current ) {
178180 clearTimeout ( debounceTimeout . current ) ;
@@ -190,7 +192,7 @@ const GooglePlacesTextInput = forwardRef(
190192 onPlaceSelect ( place ) ; // Notify parent with selected place
191193 } ;
192194
193- // Show suggestions on focus if text length > 1
195+ // Show suggestions on focus if text length > minCharsToFetch
194196 const handleFocus = ( ) => {
195197 if ( inputText . length >= minCharsToFetch ) {
196198 fetchPredictions ( inputText ) ;
You can’t perform that action at this time.
0 commit comments