Closed pratts closed 7 years ago
Thanks for trying this module.
Please create a simple plunker example to recreate your issue, so that we can debug it. Without plunker or working example, this issue will be closed.
This is the plunker I could create. In the div with id profile, an input is included that uses ng2-datetime-picker. When plunker is run, tabs do not work. When I remove the input or the ng2-datetime-picker directive, tabs work.
When I downloaded the plunker and tried to run it on my system, page refreshes whenever I try to change the tab (same as problem mentioned above).
Thank you
@pratts thanks for your example, I will look into it
Very strange, I guess that bootstrap tab does not allow the change of contents. It will take a long time to debug this if I want to make it correct because it might be only fixable by bootstrap.
I tried this issue with ng2-tab
, and it all worked fine for me.
I tried to look into the code and tried to comment the line: document.body.addEventListener('click', this.hideDatetimePicker); in the file src/date-timetime-picker.directive.ts.
It seems it binds the document with a click event to close the datetime-picker. After commenting the code I can switch through tabs but now I cannot close the picker.
Commenting the below mentioned line in hideDatetimePicker function and uncommenting line mentioned above also works: event && event.stopPropagation();
@pratts Thanks, could you make PR for that?
Hello @allenhwkim, Commenting the above mentioned lines causes the hideDatetimePicker function to run multiple time (earlier it was handled by stopPropagation), although it seemed that it was not creating any problems.
Will it be alright to make a PR of that line commented ?
@pratts can you make to run hidedatimepicker to run only 1 time using a variable? E.g if hidden already do not run it
Hello @allenhwkim , I will try and send a PR. It will take some time. Thank you for your help.
@pratts, thanks for trying my idea. LMK if it does not work
Hello, I recently tried using ng2-datetime-picker and I am currently using bootstrap also. There are two tabs and one of them contains a form containing elements that uses datetime-picker. When I click on any tab, page refreshes. When I remove 'datetime-picker', tabs work.