Issue Type:
enhancement
Description:
Would it be possible to be able to pass a data-testid attribute to the input used in the components. I only looked at the CategorySearch component so appreciate this might not be workable across the range of components.
e.g.
<input {...getInputProps({
placeholder: this.props.placeholder,
data-testid: controlName,
moreProps: this.props.additionalInfo
})} />
or a specific means of passing in attribute for use as data-* attributes. e.g.
<input {...getInputProps({
getDataAttributes( this.props.dataAttrObject, 'input'),
})} />
Reactivesearch version:
latest
This definitely looks like something we can (and should) support.
Thoughts on this @bietkul?
Yeah, we should have it.
As suggested by @dmce we can define a prop called inputProps & use it to extend the props in input elements.
The shape of the prop can be like that:
{
input: Object|Function,
checkbox: Object|Function,
radio: Object|Function,
....
}
Note: Properties can have functions, to handle the multiple input(checkbox/radio) instances in list & range components.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
This definitely looks like something we can (and should) support.
Thoughts on this @bietkul?