Office UI Fabric JS DropDown无法在IE11中运行

时间:2017-11-16 16:37:53

标签: javascript internet-explorer-11 office-ui-fabric

我有一个带有两个下拉列表的SharePoint加载项:

<div id="departments" class="ms-Dropdown ms-Grid-col ms-u-sm3" tabindex="0">
    <label class="ms-Label">Departments</label>
    <i class="ms-Dropdown-caretDown ms-Icon ms-Icon--ChevronDown"></i>
    <select class="ms-Dropdown-select" id="departmentSelect">
        <option value=""></option>
    </select>
</div>
<div id="supervisors" class="ms-Dropdown ms-Grid-col ms-u-sm3" tabindex="0">
    <label class="ms-Label">Supervisors</label>
    <i class="ms-Dropdown-caretDown ms-Icon ms-Icon--ChevronDown"></i>
    <select class="ms-Dropdown-select" id="supervisorSelect">
        <option value=""></option>
    </select>
</div>

然后通过以下方式初始化:

var DropdownHTMLElements = document.querySelectorAll('.ms-Dropdown');
for (var i = 0; i < DropdownHTMLElements.length; ++i) {
    var Dropdown = new fabric['Dropdown'](DropdownHTMLElements[i]);
}

所有其他浏览器都可以工作,但IE11永远不会加载并抛出该错误:

"Unable to get property 'querySelectorAll' of undefined or null reference"
File: fabric.min.js, Line: 7, Column: 17876

0 个答案:

没有答案