react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

wrapperClassName has no effect

Open GhosttownLLC opened this issue 1 year ago • 2 comments

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 image

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Chrome
  • Version latest

Additional context Add any other context about the problem here.

GhosttownLLC avatar Oct 12 '23 15:10 GhosttownLLC

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

wrapperClassName

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. image

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 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.

balajis-qb avatar Oct 14 '23 08:10 balajis-qb

Similar issue: If I set withPortal, wrapperClassName has no effect.

FourwingsY avatar Feb 14 '24 13:02 FourwingsY