md-datepicker不适用于引导程序模式,而适用于angularjs中的简单页面

时间:2018-08-10 08:02:05

标签: angularjs bootstrap-modal angularjs-material

我正在从有角度的材料中使用md-datepicker。除自举模态外,它工作正常。我已经应用了z-index:1200之类的各种解决方案,但没有一个对我有用。

以下我正在使用的库:

 <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-material/1.1.10/angular-material.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/angular-material/1.1.10/angular-material.min.css" />

它显示了当我使用inspect元素时的区域: enter image description here

这是模态代码:

<!-- Bootstrap Modal for Add an Event -->
<div class="modal fade" id="AddEvent" role="dialog">
    <div class="modal-dialog">
        <form ng-submit="addNewEvent()">
            <!-- Modal content-->
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title"> <span class="team-member-icon"><img class="" ng-src="home/img/event-star.svg"></span>&nbsp; Add Event</h4>
                    <button type="button" class="close" data-dismiss="modal">&times;</button>

                </div>
                <div class="modal-body">
                    <div class="add-member-modl">
                        <div class="form-group">
                            <label>Event Name</label>
                            <input ng-model="newEvent.name" type="text" ng-focus="focusInput = true" class="form-control" placeholder="Mehndi" ng-required="true">
                            <input type="hidden" ng-model="newEvent.event_id">
                            <ul class="advance_search_inner" ng-show="focusInput">
                                <li ng-repeat="event in events| filter:newEvent.name" ng-click="newEvent.name = event.name; focusInput = false; newEvent.event_id = event._id">
                                    {{event.name}}
                                </li>
                            </ul>
                        </div>
                        <div class="form-group">   
                            <label>Date</label>
                            <md-datepicker md-open-on-focus ng-model="newEvent.start_date"></md-datepicker>
                        </div>

                        <div class="form-group">   
                            <label>Duration</label>
                            <select class="form-control" ng-model="newEvent.duration">
                                <option value="1 Day">1 Day</option>
                                <option value="2 Days">2 Days</option>
                                <option value="3 Days">3 Days</option>
                            </select>
                            <!--<input type="text" class="form-control" ng-model="newEvent.duration" placeholder="1 Day(s)" ng-required="true">-->
                        </div>
                    </div>
                </div>
                <div class="modal-footer mod-footr">
                    <button type="submit" class="btn btn-default">Send</button>
                </div>
            </div>
        </form>
    </div>
</div>

1 个答案:

答案 0 :(得分:0)

模态的z索引可能高于日期选择器选择器。尝试使用以下CSS更改datepicker的z-index:

.md-datepicker-calendar-pane {
     z-index: 2000;
}