2017-10-02 14 views
0

In this plunk div 안에 각도 UI Datepicker가 있습니다 (div에는 주황색 배경이 있음). 문제는 내가 z-index: 99999을 설정하더라도 Datepicker가 잘 렸습니다. div overflow-y:auto에서 div를 제거하면 Datepicker가 표시되지만 넘칠 때 스크롤 할 div가 필요합니다. 이 문제를 해결하는 방법?Angular UI Datepicker에서 Z- 인덱스가 작동하지 않습니다.

HTML :

<div style="height:200px;padding:30px;background-color:orange;overflow-y:auto"> 
    <p class="input-group" style="z-index:99999"> 
     <input type="text" class="form-control" ng-model="dt" is-open="config.opened" 
      uib-datepicker-popup popup-placement="top-left" datepicker-options="dateOptions" 
      ng-required="true" close-text="Close" /> 
     <span class="input-group-btn"> 
     <button type="button" class="btn btn-default" ng-click="open1()"> 
      <i class="glyphicon glyphicon-calendar"></i></button> 
     </span> 
    </p> 
</div> 

자바 스크립트 :

var app = angular.module('app', ['ui.bootstrap']); 
app.controller('ctl', function ($scope) { 

    $scope.opened = false; 

    $scope.dateOptions = { 
     showWeeks: false 
    }; 

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


}); 

app.directive('dir2', function() { 
    return { 
     restrict: 'EA',   
     scope: { 
      someVar: '=' 
     }, 
     templateUrl: 'dir2.html', 
     link: function (scope, element, attrs) { 

      scope.config = {}; 
      scope.config.opened = true; 

     } 
    } 
}); 

답변

3

이 그것을 body 때문에 현재의 요소에 내용을 추가하는 더 나은 선택이 이러한 경우에 tooltip, datepicker 또는 popover 매우 일반적인 경우입니다 스타일링은 중요하지 않습니다. 기본적으로이 경우 datepikcer-append-to-bodytrue 아래로 설정하여 신체에 데이트 피커를 추가 할 수 있습니다.

datepicker-append-to-body="true" 

z-index를 설정, 그것은 몇 가지를 조정하여 작동 할 수 가지 말라, 그러나 그것은 실수 소프트웨어의 다른 조각을 깰 수 있습니다.

Plunker Demo