amazing-time-picker icon indicating copy to clipboard operation
amazing-time-picker copied to clipboard

Is there a way to programatically close the time picker?

Open s-e-r-O opened this issue 6 years ago • 3 comments

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

s-e-r-O avatar Aug 16 '18 16:08 s-e-r-O

How can that input lose focus if the pop up is still visible?

torabian avatar Nov 08 '18 17:11 torabian

User can 'tab' to lose focus the current input, I need the close picker function too :)

Thomas0921 avatar May 25 '19 07:05 Thomas0921

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" />

Thomas0921 avatar May 25 '19 08:05 Thomas0921