Vue: @keypress.prevent not preventing caret on input from moving

Created on 20 Feb 2018  路  1Comment  路  Source: vuejs/vue

Version

2.5.13

Reproduction link

https://jsfiddle.net/xby1x7yy/3/

Steps to reproduce

  1. click on the input
  2. press up, right, down or left arrow.

What is expected?

the caret on the input doesn't move.

What is actually happening?

the caret on the input is moving.

Most helpful comment

Because you need to use keydown instead of keypress (even without Vue)

>All comments

Because you need to use keydown instead of keypress (even without Vue)

Was this page helpful?
0 / 5 - 0 ratings