ReactJS – React datepicker How to open DatePicker when you click on the icon

Try to open the datepicker and click on the icon of the react-datepicker component. I have completed their documentation and question links, but found that it is not very useful.

 {...startDateOpts}
id='abc'
maxDate={moment()}
onChange={this.handleStartChange}
placeholderText='Start Date'
popoverAttachment={smallScreen?'bottom center': undefined}
popoverTargetAttachment={smallScreen?'top center': undefined}
popoverTargetOffset={smallScreen ? '0px 0px': undefined}
/>

enter image description here

I tried from React-datepicker docs link but no luck.

Just use a label to wrap the DatePicker. All clicks on the internal label call are focused on the input, that is, open the calendar.

Try to open the datepicker and click on the icon of the react-datepicker component. I have completed their documentation and question links, but found that it is not much Useful.

 {...startDateOpts}
id='abc'
maxDate={moment()}
onChange={this.handleStartChange}
placeholderText='Start Date'
popoverAttachment={smallScreen?'bottom center': undefined}
popoverTargetAttachment={smallScreen?'top center': undefined}
popoverTargetOffset={smallScreen? '0px 0px': undefined}
/>

enter image description here

Me Tried from the React-datepicker docs link but no luck.

Just wrap the DatePicker with a tag. All clicks on the inner tag call are focused on the input, that is, the calendar is opened.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5931 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.