mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Change (fix) the typing of InputProps.onBlur() to FocusEvent (#38005)
This commit is contained in:
parent
2db379b134
commit
6f4b17c37b
3
types/react-autosuggest/index.d.ts
vendored
3
types/react-autosuggest/index.d.ts
vendored
@ -7,6 +7,7 @@
|
||||
// Christopher Deutsch <https://github.com/cdeutsch>
|
||||
// Kevin Ross <https://github.com/rosskevin>
|
||||
// Thomas den Hollander <https://github.com/ThomasdenH>
|
||||
// ulrichb <https://github.com/ulrichb>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@ -65,7 +66,7 @@ declare namespace Autosuggest {
|
||||
interface InputProps<TSuggestion>
|
||||
extends Omit<React.InputHTMLAttributes<any>, 'onChange' | 'onBlur'> {
|
||||
onChange(event: React.FormEvent<any>, params: ChangeEvent): void;
|
||||
onBlur?(event: React.FormEvent<any>, params?: BlurEvent<TSuggestion>): void;
|
||||
onBlur?(event: React.FocusEvent<any>, params?: BlurEvent<TSuggestion>): void;
|
||||
value: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
@ -91,6 +91,7 @@ export class ReactAutosuggestBasicTest extends React.Component<any, any> {
|
||||
placeholder: `Type 'c'`,
|
||||
value,
|
||||
onChange: (e, changeEvent) => this.onChange(e, changeEvent),
|
||||
onBlur: (e) => { console.log(e.relatedTarget); }
|
||||
}}
|
||||
theme={theme}/>;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user