vuejs: @keyup.esc on div element is not working

前端 未结 6 624
借酒劲吻你
借酒劲吻你 2021-02-12 12:57

I\'m expecting that \'close\' event is fired when I\'m clicking ESC button being on \"shadow-modal\" div, but it\'s not happening

vue 2.5.13, any ideas why?

6条回答
  •  忘了有多久
    2021-02-12 13:44

    While it's not input element that you're trying to bind the keyborad events, they will not work unless you define a tabindex:

    Here's a reference: https://www.w3.org/WAI/GL/WCAG20/WD-WCAG20-TECHS/SCR29.html

提交回复
热议问题