question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add please focusOnOpen for DatePicker by analogy with TimePicker

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

When you click on DatePicker, you can not immediately enter the date manually, at the same time in TimePicker it is implemented.

What does the proposed API look like?

Look here: https://github.com/react-component/time-picker/blob/master/src/Header.jsx

  componentDidMount() {
    if (this.props.focusOnOpen) {
      // Wait one frame for the panel to be positioned before focusing
      const requestAnimationFrame = (window.requestAnimationFrame || window.setTimeout);
      requestAnimationFrame(() => {
        this.refs.input.focus();
        this.refs.input.select();
      });
    }
  }

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
onlyanncommented, Nov 26, 2018

Hi @chenshuai2144 Do you have permissions to review the referenced PR ?

1reaction
makhnatkincommented, Aug 23, 2018

I temporarily use this solution, because there is no access to the input field by refs. Of course this is a hack, because in fact I get into the DOM…

<RangePicker
  showTime={{ format: 'HH:mm' }}
  format="DD.MM.YYYY | HH:mm"
  onOpenChange={isOpen => isOpen ? setTimeout(() => {
    const startInput = document.querySelector('.ant-calendar-input');
    startInput.focus();
    startInput.select();
  }, 100) : null}
/>

Read more comments on GitHub >

github_iconTop Results From Across the Web

jQuery Datepicker and Timepicker for same input field to ...
Let the datepicker write the base value of the input, and have the timepicker append it's value following a space to the same...
Read more >
KendoReact DatePicker custom calendar no focus on open
When default KendoReact DatePicker is opened field gains autofocus on open. due to this when you click somewhere else on the page calendar ......
Read more >
Is there a TIME PICKER? - Power Platform Community
I have a datepicker that I use for filtering my results. ... Please help me how to insert this function on the EDIT...
Read more >
Adding a Timepicker to jQuery UI Datepicker - Trent Richardson
jQuery Timepicker Addon. Add a timepicker to your jQuery UI Datepicker. With options to show only time, format time, and much more.
Read more >
Datepicker, Timepicker &#38;amp; Select issues - MDBootstrap
Topic: Datepicker, Timepicker & Select issues ... Please visit link... ... will add wrapper with position relative it will be positioning to this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found