Skip to content

Commit dbdb653

Browse files
authored
add textInput refs directly on useImperativeHandle (#650)
1 parent 3c2c357 commit dbdb653

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

GooglePlacesAutocomplete.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ export const GooglePlacesAutocomplete = forwardRef((props, ref) => {
147147
setStateText(address);
148148
},
149149
getAddressText: () => stateText,
150-
...inputRef.current,
150+
blur: () => inputRef.current.blur(),
151+
focus: () => inputRef.current.focus(),
152+
isFocused: () => inputRef.current.isFocused(),
153+
clear: () => inputRef.current.clear(),
151154
}));
152155

153156
const requestShouldUseWithCredentials = () =>

0 commit comments

Comments
 (0)