Skip to content

Conversation

@esezen
Copy link
Contributor

@esezen esezen commented Feb 16, 2024

No description provided.

- To use this hook, an \`apiKey\` or \`cioJsClient\` are required, and an \`onSubmit\` callback must be passed to the \`useCioAutocomplete\` hook to configure behavior. All other values are optional.
- use the <a href="https://kentcdodds.com/blog/how-to-give-rendering-control-to-users-with-prop-getters" target="__blank">prop getters</a> and other variables returned by this hook (below) to leverage the functionality described above with jsx elements in your react component definitions
> **Important: Please note that all of the select or submit events should go through the \`onSubmit\` callback. The \`getItemProps\` hook returns click and keyboard handlers which should be applied to the elements using the spread operator (see code examples below). Adding an \`onClick\` event manually to the elements would override the default behavior of the library preventing it from sending tracking events and would cause different behavior between click and keyboard events. Selecting an item or submitting the search would both cause \`onSubmit\` to be called. **
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 couldn't think of a good way to add a code example here without making this more complicated. Please let me know if you have any suggestions

@esezen esezen requested a review from a team February 16, 2024 22:09
Copy link
Contributor

@HHHindawy HHHindawy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! ✌️

@esezen esezen merged commit 4b7dbc1 into main Feb 26, 2024
@esezen esezen deleted the csl-3256-os-ui-autocomplete-investigate-why-select-events-are-not branch February 26, 2024 15:47
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