sardell commented on issue #1380: METRON-1253: Manual pasting of timestamps 
into the timestamp picker
URL: https://github.com/apache/metron/pull/1380#issuecomment-493953570
 
 
   @ruffle1986 I see what you mean after testing locally. However, when add the 
toggle function and the click listener on the calendar icon back into the code, 
I can see the calendar toggling visibility if I step through with a debugger. 
After further inspection and testing, I was able to override this behavior by 
adding `bound: false` to the Pikaday configuration (this allows us to manually 
handle the open/close functionality with Angular's event binding) and adding 
`this.picker.hide();` in the ngOnInit function after Pikaday is instantiated 
(this is what prevents the re-opening of the calendar when toggling open/close).
   
   ![Screen Shot 2019-05-20 at 1 43 27 
PM](https://user-images.githubusercontent.com/7304869/58019226-52759000-7b05-11e9-907d-d1f4d1e88cde.png)
   
   
   In addition, I added `this.picker.hide();` at the end of both if statements 
inside of ngOnChanges so the calendar closes after a user chooses a date. 
   
   ![Screen Shot 2019-05-20 at 1 43 37 
PM](https://user-images.githubusercontent.com/7304869/58019236-573a4400-7b05-11e9-90f8-826416e08c6a.png)
   
   I also noticed that the calendar defaults back to `position: static` with 
the `bound: false` configuration, so I added the following to styles.scss:
   ```
   .pika-single {
     position: absolute !important;
   }
   ```
   
   After doing all that, it seems to work fine. Try it out and let me know what 
you think.
   
   
![pikaday-open-close-solution1](https://user-images.githubusercontent.com/7304869/58019273-691be700-7b05-11e9-9cf8-ebe2f49e6804.gif)
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to