How to open datetimepicker on input focus or click?

Hello. I would like to open the calendar on input click or focus. The thing is at there seems to be some bug as when I click the time picker icon it opens the date picker as well and overlays. Please let me know if you need any further clarification :)

3 Replies

SN Sevvandhi Nagulan Syncfusion Team April 29, 2020 06:34 AM UTC

Hi Konnos, 
 
Greetings from Syncfusion support. 
 
In the click event of the input element you can call the show method based on the target. Kindly refer the below code, 
 
 
  this.datetimePickerObj.element.addEventListener('click', (e) => {  
    if((e.target as any).classList.contains('e-input')) { 
            this.datetimePickerObj.show(); 
    } 
   },this.datetimePickerObj);  
   } 
 
 

Regards, 
Sevvandhi N 



KK Konnos Kall April 29, 2020 08:01 AM UTC

Thank a lot this solved this :)


SN Sevvandhi Nagulan Syncfusion Team April 30, 2020 03:47 AM UTC

Hi Konnos, 
 
Thanks for the update. Please let us know if you need any other further assistance on this. 
 
Regards, 
Sevvandhi N 


Loader.
Up arrow icon