手风琴标题中的<input />(0.11.2 vs. 0.12.0)

时间:2014-11-19 23:11:07

标签: angular-ui-bootstrap

在0.11.2中,<accordion-heading>中的输入可能是这样的:

<input type="text" value="Will open / close containing group on click" />
<input type="text" ng-click="$event.stopPropagation()" value="Will do nothing" />

在0.12.0中,点击第二个输入似乎会触发导航到根页面(.../#/path - &gt; .../):http://plnkr.co/pyjENpDew621TLTb3Uom

进一步调查显示,突破变化为make header links keyboard accessible 如何正确阻止元素在新版本中切换手风琴?

1 个答案:

答案 0 :(得分:1)

Ugly Hack:我遇到了同样的问题并最终覆盖了accordion-group.html模板以删除“href”属性。

(function () {
    'use strict';

    function templateOverrides($templateCache) {
        var accordionGroupTemplate =
            '<div class=\"panel panel-default\">' +
            '   <div class=\"panel-heading\">' +
            '       <h4 class=\"panel-title\">' +
            '           <a class=\"accordion-toggle\" ng-click=\"toggleOpen()\" accordion-transclude=\"heading\"><span ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>' +
            '       </h4>' +
            '   </div>' +
            '   <div class=\"panel-collapse\" collapse=\"!isOpen\">' +
            '       <div class=\"panel-body\" ng-transclude></div>' +
            '   </div>' +
            '</div>';

        $templateCache.put('template/accordion/accordion-group.html', accordionGroupTemplate);
    }

    angular
        .module('app')
        .run(['$templateCache', templateOverrides]);
})();