Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

click on input to close the select popup ? #182

Open
johnico opened this issue Feb 9, 2017 · 6 comments
Open

click on input to close the select popup ? #182

johnico opened this issue Feb 9, 2017 · 6 comments

Comments

@johnico
Copy link

johnico commented Feb 9, 2017

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

@Gillardo
Copy link
Owner

Gillardo commented Feb 9, 2017

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

@johnico
Copy link
Author

johnico commented Feb 9, 2017

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

@Gillardo
Copy link
Owner

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

@johnico
Copy link
Author

johnico commented Feb 11, 2017

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

@Gillardo
Copy link
Owner

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

@johnico
Copy link
Author

johnico commented Feb 13, 2017

could you show me an example please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants