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

0.12 UI Bootstrap issues with single-click #126

Closed
mrozlukasz opened this issue Dec 23, 2014 · 3 comments
Closed

0.12 UI Bootstrap issues with single-click #126

mrozlukasz opened this issue Dec 23, 2014 · 3 comments

Comments

@mrozlukasz
Copy link

Hi,

Awesome job was done right here. The following issues was found while implementing the datetimepicker with bootstrap ui.

  1. Currently the component is double clicked, so in my opinion, has very poor usability for the end user.
  2. Even though there is an option to eliminate the double-click, there is a problem with closing the dropdown.

I have good news, both issues can be solved!

Here are the instructions:

  1. Upgrade the ui bootstrap to 0.12. The event collision with bootstrap.js was removed (single click working).
  2. Additional attrributes are required : dropdown and dropdown-toggle
  3. Bootstrap UI dropdowns now have is-open attribute observed, so toggling the value will do the closing/opening trick
<div class="dropdown" dropdown is-open="status.isopen">
  <a class="dropdown-toggle" dropdown-toggle role="button" data-toggle="dropdown" data-target="#" href="#">
    <div class="input-group"><input type="text" class="form-control" data-ng-model="data.dateDropDownInput"><span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
    </div>
  </a>
  <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
    <datetimepicker data-ng-model="data.dateDropDownInput" on-set-time="onTimeSet(newDate,oldDate)"/>
  </ul>
</div>
$scope.status = { isopen: false }
$scope.onTimeSet = function (newDate, oldDate) {
    $scope.status.isopen = false;
}
@dalelotts
Copy link
Owner

Thanks! It's nice to know that the bootstrap UI issues are getting fixed!

@dalelotts
Copy link
Owner

Would you mind doing a PR for the documentation and perhaps a demo page so others can make use of this example without searching through closed issues?

@mrozlukasz
Copy link
Author

Yes, I can do this. I'll try to find a couple of hours this week.

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