reactivesearch
reactivesearch copied to clipboard
DataSearch input field custom attributes
Issue Type: enhancement
Platform: Web
Description: I am looking for a way to add custom attributes to the input field of my DataSearch component.
My use case is that I'd like to add aria-labels to my input for seo related issues. Chrome lighthouse complains about this.

Reactivesearch version: 3.0.0
Browser: all
We can have a new prop in search components to define the props applied to input element.
Meanwhile, you can use ref to set the attributes.
for example:
- Access the input ref
<DataSearch
ref={ c => this.inputRef = c._inputRef; }
/>
- Use it to set attributes
React.findDOMNode(this.inputRef).setAttribute('aria-label', 'xyz');
Similarly, adding type="search" to the DataSearch component's input would improve accessibility for mobile devices and screen readers.