bootstrap-ui-datetime-picker icon indicating copy to clipboard operation
bootstrap-ui-datetime-picker copied to clipboard

click on input to close the select popup ?

Open johnico opened this issue 8 years ago • 6 comments
trafficstars

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

johnico avatar Feb 09 '17 08:02 johnico

Can you not just change the isOpen variable that you have to open/close the datetimepicker?

Gillardo avatar Feb 09 '17 09:02 Gillardo

@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)

johnico avatar Feb 09 '17 16:02 johnico

Can you create a simple plunkr and i can have a look?

Gillardo avatar Feb 10 '17 08:02 Gillardo

@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>

johnico avatar Feb 11 '17 10:02 johnico

Would it not be better to use the blur and focus events?

Gillardo avatar Feb 12 '17 17:02 Gillardo

could you show me an example please?

johnico avatar Feb 13 '17 07:02 johnico