Ion-datetime not closing on Android back button


#1

I see the ion-datetime component does not close on the Android back button; am I missing something, or is there a programatic way to close it?


#2

This should do the trick

ionViewWillLeave(){
        let backDrop: any = document.getElementsByTagName('ion-picker-cmp');
        if(backDrop.length > 0){
            for(let i = 0; i< backDrop.length; i++){
                backDrop[i].style.display = 'none';
            }
        }
      }