-1

This issue is related to accessibility. When user is clicking the esc button, its calling the button action. I am using the below code.

<a ng-click="MyAction();" ng-keypress="My Action();" translate="Hellow_world">Hellow World</a>.

How we can avoid calling the esc action button. This issue is only happening in IE. Any suggestion would be appriciated

Ankit
  • 9
  • 1

1 Answers1

0

This is the solution for you, when any key pressed that will call your function but before calling it will control keycode, ESC keycode is 27 and it will except ESC key.

<a ng-click="MyAction()" ng-keypress="$event.keyCode != 27 && My Action()" translate="Hellow_world">Hellow World</a>
FarukT
  • 1,560
  • 11
  • 25
  • @Ankit if it works why didn't you accept as resolved my answer? – FarukT Feb 02 '18 at 21:07
  • Hi Faruk, I don't have enough reputation so I can not vote for this answer. System is not allowing me. Thanks again for your help – Ankit Feb 02 '18 at 21:17