Describe the bug
The Datepicker popover position is always in the middle of CustomInput, it does not consider the ref element's position.
To Reproduce
In the following example, despite ref being set on the button, the calendar popover is positioned with respect to the outer div, specifically positioned with respect to center of div.
() => {
const [startDate, setStartDate] = useState(new Date());
const buttonRef=React.useRef(null);
const ExampleCustomInput = forwardRef(({ value, onClick }, ref) => (
<div style={{display:'flex', border:"1px solid red", justifyContent:"space-between"}}>
{value}
<button className="example-custom-input" onClick={onClick} ref={ref}>
>>
</button>
</div>
));
return (
<DatePicker
selected={startDate}
onChange={(date) => setStartDate(date)}
customInput={<ExampleCustomInput />}
/>
);
};
Expected behavior
Calendar popover should be positioned with respect to the button
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
