2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-22 10:30:34 +03:00

Change all keyup events to keydown (#935)

For a few reasons:

- event.preventDefault() for the Enter key (to stop it from submitting
  the form when you select an item) is only effective if it's a keydown
  event.

- Using keydown for up/down navigation means you can hold them down to
  rapidly scroll through a lot of items.

- Keydown events make the UX feel more responsive, and is consistent
  with how most apps/operating systems handle key presses.
This commit is contained in:
Toby Zerner
2019-10-26 06:42:59 +10:30
committed by Jeff Sagal
parent aea81a6f5c
commit ceb42b4950
4 changed files with 11 additions and 22 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ export const searchSubmit = (Wrapper, searchText = false) => {
if (searchText) {
Wrapper.vm.search = searchText;
}
Wrapper.find({ ref: "search" }).trigger("keyup.enter")
Wrapper.find({ ref: "search" }).trigger("keydown.enter")
};
/**