vue-scrollto icon indicating copy to clipboard operation
vue-scrollto copied to clipboard

v-scroll-to breaks HTML5 form validation with Enter

Open IlyaSemenov opened this issue 6 years ago • 1 comments
trafficstars

Problem

If a HTML form has a button with v-scroll-to, that breaks form validation which occurs when a user presses Enter.

Steps to reproduce

  1. Open jsfiddle at https://jsfiddle.net/semenov/ukt84qvy/7/
  2. Type something in input 1, press Enter. The form validation for input 2 will NOT kick in, instead the page will be scrolled to a seemingly random (?) location:
Screenshot 2019-09-09 at 16 56 04
  1. Edit jsfiddle, remove v-scroll-to, re-run it.
  2. Type something in input 1, press Enter. The form validation for input 2 WILL kick in, and the page will be scrolled to show input 2:
Screenshot 2019-09-09 at 16 55 32

Expected behavior

Regardless of v-scroll-to, pressing Enter in a form scrolls to the input element that doesn't pass validation.

IlyaSemenov avatar Sep 09 '19 10:09 IlyaSemenov

Adding type="button" seems to help; still this is a weird behaviour.

IlyaSemenov avatar Sep 09 '19 10:09 IlyaSemenov