react-datepicker
react-datepicker copied to clipboard
wrapperClassName has no effect
Describe the bug A clear and concise description of what the bug is. Usage of wrapperClassName has no effect
To Reproduce Steps to reproduce the behavior:
<DatePicker
selected={startDate}
inline
wrapperClassName={"dp-full-width"}
onChange={(date) => setStartDate(date)}
showTimeSelect
minDate={new Date()}
timeFormat="h:mm aa"
timeIntervals={30}
timeCaption={"Time"}
dateFormat={"MM/DD/yyyy h:mm aa"}
/>
Expected behavior Add wrapper class
Screenshots
Desktop (please complete the following information):
- OS: Windows 11
- Browser Chrome
- Version latest
Additional context Add any other context about the problem here.
Hi @GhosttownLLC ,
I don't feel this as an bug. The wrapperClassName gets applied to the wrapper of the input element, not to the wrapper of the date-picker component itself
If you notice in the above screenshot, the class gets applied to the wrapper of the input element, not to the complete component
In your example, you shared the below part of the component, which won't get affected by the wrapperClassName anyway. If it got the wrapperClassName, even the background class name and the padding I applied would get applied here aswell. But currently wrapperClassName is not getting applied to the component itself, but just the wrapper of the input element.
In the example you shared, as you are using the inline version of the DatePicker, we won't get the input element itself. Hence only you are not getting the wrapperClassName
@martijnrusschen , let me know we want to change the current behaviour of the wrapperClassName to be applied to the whole component, instead of just the input element, else, this issue can be closed.
Similar issue: If I set withPortal
, wrapperClassName has no effect.