amazing-time-picker
amazing-time-picker copied to clipboard
Is there a way to programatically close the time picker?
I need to close the time picker once the input that uses it loses focus. I haven't found a way to do it yet.
Have you found a solution? Thanks in advance
How can that input lose focus if the pop up is still visible?
User can 'tab' to lose focus the current input, I need the close picker function too :)
Just found a way to avoid opening new pop up when existing pop up has not close. You need to programmatically open a pop up first, and define a variable to check if there is pop up. Toggle it in the function like this.
openTimePicker(event) { event.stopPropagation(); if (!this.hasPopUp) { const atp = this.atp.open(); this.hasPopUp = true; atp.afterClose().subscribe(time => { this.hasPopUp = false; }); } }
Update
the afterClose() is not called, when click 'Back', or the 'backdropdismiss'.
Can limit the user tab by changing the tabIndex
<input type="text" tabindex="-1" name="tbx" id="tbx" />