2014-04-29 34 views
0

與IE瀏覽器測試下正常工作11選擇列表不IE

HTML:

<div data-ng-app="testApp"> 
    <div data-ng-controller="testCtrl"> 
     <select id="filter" ng-model="messageViewModel.filter" ng-options="f.name for f in messageViewModel.filters"></select> 
    </div> 
</div> 

JS:

var testApp = angular.module('testApp', []); 

testApp.controller('testCtrl', function ($scope) { 
    $scope.messageViewModel = {}; 
    $scope.messageViewModel.filters = [{ id:1, name: "test1"}, { id:2, name: "test2"}, { id:3, name: "test3"}]; 
    $scope.messageViewModel.filter = $scope.messageViewModel.filters[0]; 
}); 

http://jsfiddle.net/u69PT/28/

步驟:

  1. 從選擇列表中選擇一個選項
  2. 選擇該選項。然後嘗試選擇另一個選項。

結果:選擇列表打開「向上」。

任何想法?我不確定它是相關的,但我使用angularjs來填充選擇列表。

+0

我認爲這與默認的IE行爲與select元素(測試它沒有angular.js)有關。沒有幫助,但...也許這可以幫助:http://stackoverflow.com/questions/19056593/can-i-control-positioning-of-ie-10-select-boxes – sinisake

回答

0

這只是Internet Explorer的默認行爲。它通過選擇框保持選定的選項級別。 這意味着隨着您進一步向下選擇列表,打開時下拉開始向上移動。

我相信自從IE 10以來一直這樣做。