Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have an Angular app that I am using UI Bootstrap. I have a modal with a Datepicker at the bottom of the modal. When expand the Datepicker, it stays inside the modal. I have tried changed the z-index, but that does not change anything. Here is my html for the Datepicker:

<div class="control-group">
  <label class="control-label">Birth Date:</label>
  <div class="controls">
    <div class="form-horizontal" ng-controller="DatepickerCtrl">
      <input name="birthdate" class="input-thick" type="text" datepicker-popup="MM/dd/yyyy" ng-model="model.dateOfBirth" is-open="opened" min="minDate" max="'2013-11-11'" datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true" required />
      <button class="btn" ng-click="open()"><i class="icon-calendar"></i></button>
      <p ng-show="!addPatientForm.birthdate.$valid && formSubmitted" class="form-error"><i class="fa fa-exclamation-circle "></i> <b>Date of Birth: </b>Enter a date in the format MM/DD/YYYY. It cannot be a future date.</p>
    </div>
  </div>
</div>

And the js:

App.controller('DatepickerCtrl', function ($scope, $routeParams, $modal, $timeout) {
  $scope.today = function() {
    $scope.dt = new Date();
  };

  $scope.today();

  $scope.showWeeks = true;

  $scope.toggleWeeks = function () {
    $scope.showWeeks = ! $scope.showWeeks;
  };

  $scope.clear = function () {
    $scope.dt = null;
  };

  $scope.toggleMin = function() {
    $scope.minDate = ( $scope.minDate ) ? null : new Date();
  };

  $scope.open = function() {
    $timeout(function() {
      $scope.opened = true;
    });
  };

  $scope.dateOptions = {
    'year-format': 'yy',
    'starting-day': 1
  };
});

Here is a plunker to show my issue. What do I need to do to make my Datepicker show up correctly?

share|improve this question
2  
Can you provide a jsFiddle ? Also, I'd recommend using Angular Strap directives for bootstrap ui elements, they worked much better for me. AngulatStrap: datepicker –  Ulugbek Nov 26 '13 at 13:55
    
I added a plunker to show the problem. –  jhamm Nov 26 '13 at 16:02
    
@Ulugbek I wonder how pure Bootstrap CSS issue is related to a JavaScript integration library (strap or angular-ui/bootstrap).... –  pkozlowski.opensource Nov 26 '13 at 18:20
    
It isnt, I just thought it was related. –  jhamm Nov 27 '13 at 11:27

1 Answer 1

up vote 1 down vote accepted

Removing the style overflow-y: auto from .modal-body fixes the issue. Right now, the overflow-y attribute automatically adds the scrollbar when the content overflows (in this case, the datepicker) rather than allowing it to overflow outside of the modal-body.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.