Skip to content

Commit 974d786

Browse files
avishainethanshar
andauthored
isFocused method added (#1833)
Co-authored-by: Ethan Sharabi <[email protected]>
1 parent 2d8be87 commit 974d786

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

demo/src/screens/MainScreen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class MainScreen extends Component {
103103
};
104104

105105
closeSearchBox = () => {
106-
this.input.blur();
106+
this.input?.blur();
107107
};
108108

109109
setDefaultScreen = item => {

src/incubator/TextField/useImperativeInputHandle.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const useImperativeInputHandle = (ref: React.Ref<any>, props: Pick<TextInputProp
77
const context = useContext(FieldContext);
88
useImperativeHandle(ref, () => {
99
return {
10+
isFocused: () => inputRef.current?.isFocused(),
1011
focus: () => inputRef.current?.focus(),
1112
blur: () => inputRef.current?.blur(),
1213
clear: () => {

0 commit comments

Comments
 (0)