Disabled button is clickable on Edge browser

后端 未结 4 1898
轻奢々
轻奢々 2020-12-20 17:06

I have problem with Edge browser. In my web site I have buttons with span tags inside them. In this span tags I bind text and icons. So far I had no problem but on Edge brow

4条回答
  •  心在旅途
    2020-12-20 17:51

    One work around I've come up with using angularjs is inspired by Ben Nadel's blog here

    So for example:

    angular.module('myModule').directive(
        "span",
        function spanDirective() {
            return ({
                link: function (scope, element, attributes) {
                    element.bind('click', function (e) {
                        if (e.target.parentNode.parentNode.disabled || e.target.parentNode.disabled) {
                            e.stopPropagation();
                        }
                    })
                },
                restrict: "E",
            });
        }
    );
    

提交回复
热议问题