In my application, I'd like to use bootstrap-datetimepicker library, which lets you have a date and time picker on the website.
I just put the datepicker in my HTML (some divs and input). I also added the script that initializes the whole thing.
I observed a strange behaviour: if my datetimepicker is placed inside Vue div, it doesn't work! (when I click on the input field, the calendar should be displayed). When I put the picker outside of Vue DIV it works perfectly.
Generally, I noticed that Vue blocks mouse events, i had the same issue with MetricsGraphics.js library (for drawing graphs) - if i put it inside Vue DIV, mouse hover events do not work at all. i had to put it outside of Vue.
What's the reason for that? In case of datetimepicker, I can't put it outside of Vue, because I'd like to use Vue capabilities on it.
I didn't include any code, but basically, this doesn't work:
<div>
<div id="vue-app">
<!-- DATE_TIME PICKER: -->
<div class="form-group">
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div>
<div>
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker();
});
</script>
And this works:
<div>
<div id="vue-app">
<div>
<!-- DATE_TIME PICKER: -->
<div class="form-group">
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div>
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker();
});
</script>