Closed kmsomebody closed 2 weeks ago
Hi @martijnrusschen,
Please assign this issue to me. I'll work on this.
Hey I have create a pull request, you can out the solution there. Now the input bar is getting toggled in one click @kmsomebody
When I analyzed this issue, it's not related to the example of the custom time input we use. But also with the default time input.
We can reproduce the double click time input issue mentioned using one of the following code
() => {
const [startDate, setStartDate] = useState(new Date());
return (
<DatePicker
selected={startDate}
onChange={(date) => setStartDate(date)}
timeInputLabel="Time:"
dateFormat="MM/dd/yyyy h:mm aa"
shouldCloseOnSelect={false}
showTimeInput
/>
);
};
() => {
const [startDate, setStartDate] = useState(new Date());
const ExampleCustomInput = forwardRef(
({ value, onClick, className }, ref) => (
<button className={className} onClick={onClick} ref={ref}>
{value}
</button>
),
);
return (
<DatePicker
selected={startDate}
onChange={(date) => setStartDate(date)}
customInput={<ExampleCustomInput className="example-custom-input" />}
/>
);
};
@martijnrusschen, can you please assign this issue to me. I fixed the issue, will raise a PR in sometime.
Describe the bug The time input does not focus when you click on it the first time. It needs 2 clicks to focus.
To Reproduce
Expected behavior The time input should be focused the first time you click on it.
Desktop
Additional context Upgraded from react-datepicker 4.17.0 to 7.2.0. It was working fine before.