所以我对 ng-disabled 有这个奇怪的问题,也许其他人可以看看?最重要的问题是,当搜索框获得焦点时,我无法再将大多数可选项卡元素集中在模式上,甚至是关闭模式的“X”。搜索框包含在helpSearchTermsDiv
div 中。一旦获得焦点,我只能通过其父 div 中的可聚焦元素进行选项卡helpPopupHeader
。我有一个包含以下指令的模式(jquery ui):
helpModule.directive("helpDialog", ['helpService', '$timeout', 'translationService', function (helpService, $timeout, translationService) {
return {
replace: true,
restrict: 'A',
scope: {
hc: '=helpHc',
staticsBaseUrl: '@'
},
template: ' <div id="help-dialog">' +
' <div id="helpPopup" style="height:100%" class="help-dialog-contents-container">' +
' <div id="helpPopupHeader" class="help-popup-header help-header">' +
' <div id="helpPanelIconsDiv" class="help-panel-icons-div">' +
' <button type="button" class="help-icon-small-back help-icon-small" ng-click="hc.back()" ng-disabled="!hc.canBack()" title="' + translationService.getMessage('SHOW_PREVIOUS') + '"></button>' +
' <button type="button" class="help-icon-small-next help-icon-small" ng-click="hc.next()" ng-disabled="!hc.canNext()" title="' + translationService.getMessage('SHOW_NEXT') + '"></button>' +
' <a class="help-toc-link" ng-click="helpToc()">'+translationService.getMessage("CONTENTS")+'</a>' +
' <a class="help-index-link" ng-click="ctrl.helpIndex()">'+translationService.getMessage("INDEX")+'</a>' +
' </div>' +
' <div id="helpSearchTermsDiv" class="help-search-terms-div">' +
' <input id="helpSearchTerms" ng-model="helpSearchTerms" title="{{searchHint}}" name="helpSearchTerms" ui-keyup="{\'enter\':\'helpSearch($event)\'}" ng-class="fieldClasses()" type="text" maxlength="50"/>' +
' <button type="button" id="helpsubmitSearch" ng-disabled="searchHint == helpSearchTerms" class="help-search-button" title="' + translationService.getMessage('SEARCH_SUBMIT') + '" ng-click="helpSearch($event)"></button>' +
' </div>' +
' </div>' +
' <div id="help-popup-content" class="help-popup-panels">' +
....
如果我从按钮中删除 ng-disabled helpsubmitSearch
,我可以通过模式中的所有可选项卡元素进行选项卡。此外,如果我单击模态框(因此搜索框失去焦点),我可以通过标签浏览所有元素,直到我回到搜索框并且只能通过helpPopupHeader
div 浏览。知道为什么会这样或我可以尝试的事情吗?