You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 19, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 19, 2019. It is now read-only.
Don't return a div but just an array (React 16) #298
Because the output for the react-autocomplete contains the input element inside a div.
Instead, I'd like to be able to output only an input element and render it right beside a label, so I can focus the input field and style the next sibling label element accordingly.
Since React 16 I believe you can also render as follows:
Sure! At some point we'll drop support for React <16 and this will be how the component functions, but until then this is a good compromise. Create a PR and I'll review it as soon as I have time.
Right now I can't do this in CSS:
input:focus + label { color: red; }Because the output for the react-autocomplete contains the
inputelement inside adiv.Instead, I'd like to be able to output only an
inputelement and render it right beside alabel, so I can focus the input field and style the next siblinglabelelement accordingly.Since React 16 I believe you can also render as follows:
You'd need to provide a
keyattribute to each child.The containing
divcould be skipped since it offers no functional meaning, you could make it the default for old-times sake.Thoughts?