https://github.com/srph/vue-issue2017
[FIXED] A replication of on-submit bug in Vue.js 1
https://github.com/srph/vue-issue2017
Last synced: about 1 month ago
JSON representation
[FIXED] A replication of on-submit bug in Vue.js 1
- Host: GitHub
- URL: https://github.com/srph/vue-issue2017
- Owner: srph
- Created: 2015-12-13T09:23:51.000Z (over 10 years ago)
- Default Branch: gh-pages
- Last Pushed: 2015-12-14T04:07:48.000Z (over 10 years ago)
- Last Synced: 2025-01-26T17:15:44.686Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://srph.github.io/vue-issue2017
- Size: 215 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# vue-js-on-submit-bug
A replication of on-submit *bug*. [Demo](https://srph-playground.github.io/vue-js-on-submit-bug)
### Track
Track https://github.com/vuejs/vue/issues/2017.
**Update**: [0efdd80](https://github.com/vuejs/vue/commit/0efdd8080721b5288f086b8c7d6bd8bce4f4af5a) fixes this. Thanks to [yyx990803](https://github.com/yyx990803).
### Elaboration
Clicking "enter" on an input (this triggers the `on:submit` event) does not remove the data from the input, while clicking the `submit` button does.

### Expected
The input (in the create form) will become blank when I submit the form.
### Actual
The input only becomes empty when I click the click the "create" button. When I try to press the `enter` key, everything works except that the input is emptied (which is intended).
### Replicating
1. Click on the "create a new task" button
2. Fill the input with characters (anything)
3. Press the enter key.
4. Click "create a new task" button, you should be able to see the input filled with the last value you filled it with (broken; unintended).
5. Repeat steps 1-2.
6. This time, click the "create" button.
7. Click "create a new task" button, you should be able to see an empty input (actual; expected).
### Running
```bash
npm install
npm run build # or npm run watch
open index.html
```
### Note
Hello, I wrote this while being awake for around 18 hours (because Vue suddenly caused an *itch*). That said, I did a lot of patterns which I did not understand.
Feel free to point them out.