Ukit modal prevent close on escape button
<p>I'm using Uikit with Angularjs and i need create possibly a directive that prevent the closing of the Modal when i press esc button. I tried with this way:</p>

<pre><code>mainApp.directive('ngEsc', function () {
    return function (scope, element, attrs) {
        element.bind("keydown keypress keyup", function (event) {
            if(event.which === 27) {
                event.preventDefault();
            }
        });
    };
});
</code></pre>

<p>And then put the directive on the modal</p>


    
        
        Test modal
    


<p>But it still closes. Is there any other way?</p>