Reactivesearch: Data/Test Attributes

Created on 14 Jan 2019  路  3Comments  路  Source: appbaseio/reactivesearch

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

wontfix

Most helpful comment

This definitely looks like something we can (and should) support.

Thoughts on this @bietkul?

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tiagogm picture tiagogm  路  3Comments

ymzoughi picture ymzoughi  路  4Comments

davidklebanoff picture davidklebanoff  路  4Comments

danielsnider picture danielsnider  路  4Comments

scheiblr picture scheiblr  路  3Comments