Close InputDate Control When Clicking on the Selected Date

Posted by: johnny.su on 6 June 2019, 5:16 am EST

    • Post Options:
    • Link

    Posted 6 June 2019, 5:16 am EST

    Hi,

    It doesn’t seem like you can close the date dropdown control when clicking on the selected date but closes when selecting a different date. Is it possible to change the behavior to close the dropdown when clicking on any date (already selected or not)?

    Desire behavior:

    1. Open date dropdown. Current date is selected.
    2. Click on the selected date.
    3. Dropdown closes.

    Thanks,

    Johnny

  • Posted 6 June 2019, 5:20 pm EST

    Hello Johnny,

    You may close the Calendar dropdown on selecting the selected date by handling the click event for Calendar and check if the date is selected date. If yes, close the calendar control using InputDate control.

    Please refer to the following sample and code snippet:

    https://jsfiddle.net/7pwt3khs/

    inputDate.calendar.hostElement.addEventListener("click",function(e){
        	if(wijmo.hasClass(e.target,'wj-state-selected')){
          	inputDate.isDroppedDown=false;
          }
        },true);
    

    Hope it helps!

    Regards,

    Manish Gupta

  • Posted 7 June 2019, 3:10 am EST

    Thank you Manish!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels