bootstrap-ui-datetime-picker
bootstrap-ui-datetime-picker copied to clipboard
click on input to close the select popup ?
HI - how can i close the select popup if the user click again on the input - even the popup is open , as in regular selectbox ?
thanks a lot
Can you not just change the isOpen variable that you have to open/close the datetimepicker?
@Gillardo thx How I detect second click its work to change the ng-model isOpen . but it always close it
also if i close outside the select i can not detect it and then the isOpen model did not changed i tried this but the outside click make the problem
$('#toTime').click(function(){
cntPicker1++;
console.log(scope.isPickerToTimeOpen);
if(scope.isPickerToTimeOpen == true && cntPicker1 == 2)
{
scope.isPickerToTimeOpen = false;
cntPicker1 = 0;
}
console.log(scope.isPickerToTimeOpen);
scope.$apply();
});
i put directive on div above input and pass parma (can not add directive on the input cause multiple directive error occurred)
Can you create a simple plunkr and i can have a look?
@Gillardo thx again did not manage to create a plunker but im usung your simple demo
the difference is that i ' m not using the clock icon - i have the ng click in the input field so i want the input will also click the time form and no just open it thx
<p class="input-group">
<input type="text" ng-click="ctrl.openCalendar($event, 'picker2')" class="form-control" datetime-picker="HH:mm" ng-model="ctrl.picker2.date" is-open="ctrl.picker2.open" enable-date="false" timepicker-options="ctrl.picker2.timepickerOptions" close-on-selection="true">
</p>
Would it not be better to use the blur and focus events?
could you show me an example please?