-
Notifications
You must be signed in to change notification settings - Fork 734
chipsInput add onFocus callback #1667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/components/chipsInput/index.tsx
Outdated
@@ -298,6 +298,7 @@ class ChipsInput extends Component<OwnProps, State> { | |||
} | |||
|
|||
onFocus = () => { | |||
_.invoke(this.props, 'onFocus'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use optional chaining and pass the event (i.e. e: NativeSyntheticEvent)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can do the same for 'onBlur' that will be much appreciated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't use optional chaining, because onKeyPress above is using lodash invoke.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type should be NativeSyntheticEvent<TextInputFocusEventData>
otherwise it fails on TS error
@vidmantas0010 Merge master to your branch (will fix failed build) |
@vidmantas0010 Pull master again, we had tests failing that broke the builds |
Closing this. |
Description
ChipsInput add onFocus callback prop
Changelog
chipsInput