Skip to content

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

Closed
wants to merge 5 commits into from
Closed

Conversation

vidmantasz
Copy link
Contributor

Description

ChipsInput add onFocus callback prop

Changelog

chipsInput

@vidmantasz vidmantasz requested a review from ethanshar November 16, 2021 08:56
@@ -298,6 +298,7 @@ class ChipsInput extends Component<OwnProps, State> {
}

onFocus = () => {
_.invoke(this.props, 'onFocus');
Copy link
Collaborator

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)

Copy link
Collaborator

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!

Copy link
Contributor Author

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.

Copy link
Collaborator

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

@Inbal-Tish Inbal-Tish self-assigned this Nov 16, 2021
@Inbal-Tish
Copy link
Collaborator

@vidmantas0010 Merge master to your branch (will fix failed build)

@Inbal-Tish
Copy link
Collaborator

@vidmantas0010 Pull master again, we had tests failing that broke the builds

@ethanshar
Copy link
Collaborator

Closing this.
We changed our implementation, we're now using Incubator.ChipsInput internally.
@vidmantas0010 This should now work for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants