Skip to content

Commit 00ecb0e

Browse files
committed
add onFocus to SearchBoxProps
1 parent a095aae commit 00ecb0e

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

types/react-instantsearch-dom/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export interface SearchBoxProps extends CommonWidgetProps {
127127
onReset?: ((event: React.SyntheticEvent<HTMLFormElement>) => any) | undefined;
128128
onChange?: ((event: React.SyntheticEvent<HTMLInputElement>) => any) | undefined;
129129
onKeyDown?: ((event: React.KeyboardEvent<HTMLInputElement>) => any) | undefined;
130+
onFocus?: ((event: React.FocusEvent<HTMLInputElement>) => any) | undefined;
130131
}
131132
/**
132133
* The SearchBox component displays a search box that lets the user search for a specific query.

types/react-instantsearch-dom/react-instantsearch-dom-tests.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,16 @@ import {
215215

216216
function onSearchBoxKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {}
217217

218+
function onSearchBoxFocus(event: React.FocusEvent<HTMLInputElement>) {}
219+
218220
function onSearchBoxReset(event: React.SyntheticEvent<HTMLFormElement>) {}
219221

220222
function onSearchBoxSubmit(event: React.SyntheticEvent<HTMLFormElement>) {}
221223

222224
<SearchBox
223225
onChange={onSearchBoxChange}
224226
onKeyDown={onSearchBoxKeyDown}
227+
onFocus={onSearchBoxFocus}
225228
onReset={onSearchBoxReset}
226229
onSubmit={onSearchBoxSubmit}
227230
submit={<></>}

0 commit comments

Comments
 (0)