Not able to close the datepicker while pressing ESC key for custom Input #4615
Unanswered
DhivyaSundararajan
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I wanted to know if there is any way to close the datepicker by pressing ESC key for custom input. Rightnow I could not do it. It only allows to close the datepicker only after selecting the date for custom input.
Here is my datepicker.tsx file
() => { const [startDate, setStartDate] = useState(new Date()); const ExampleCustomInput = forwardRef(({ value, onClick }, ref) => ( <input value={value} onClick={onClick} ref={ref}/> )); return ( <DatePicker selected={startDate} onChange={(date) => setStartDate(date)} customInput={<ExampleCustomInput />} /> ); };
https://reactdatepicker.com/#example-custom-input
Any help is appreciated!!
Beta Was this translation helpful? Give feedback.
All reactions