customInput doesn't respect className
When I pass a customInput with a div as the outermost wrapper, any classNames associated with that div are removed in rendering. For example,
<div className="potatoes">
<input />
<button>hi</button>
</div>
Is rendered as
<div>
<input />
<button>hi</button>
</div>
I also notice that an id is stripped from the outermost component, and that changing the element type of the outermost component doesn't prevent this from happening.
Is there a reason for this or it's just a quirk? Thanks!
Hey! I was trying this out earlier and noticed that too - if I passed an element in with className, the html would show a class attribute with nothing else there.
In my case, I was just passing in a render function into customInput such as
render () {
return <DatePicker
customInput={this.renderInput()}
/>
}
renderInput () {
return <div className="test" />;
}
I was able to get the classes to work when I took the custom input out of the React class and into its own CustomInput component. Hope that helps!
@heatherbooker @serkolch The docs where not clear on this, I got the className to render on the customInput when providing it to the parent <DatePicker /> component.
This will render the custom-class on the button component
<DatePicker
className="custom-class"
customInput={<Button>{value}</Button>}
/>
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.