Skip to content

Commit

Permalink
fix keycode on End and Home
Browse files Browse the repository at this point in the history
  • Loading branch information
curiosity26 committed Jan 11, 2021
1 parent e5c7b0c commit b6f961a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/__tests__/type.js
Original file line number Diff line number Diff line change
Expand Up @@ -1091,9 +1091,9 @@ test('navigation key: {home} and {end} moves the cursor', () => {
input[value="c"] - input
"{CURSOR}" -> "c{CURSOR}"
input[value="c"] - keyup: c (99)
input[value="c"] - keydown: Home (35)
input[value="c"] - keydown: Home (36)
input[value="c"] - select
input[value="c"] - keyup: Home (35)
input[value="c"] - keyup: Home (36)
input[value="c"] - keydown: a (97)
input[value="c"] - keypress: a (97)
input[value="ac"] - input
Expand All @@ -1106,9 +1106,9 @@ test('navigation key: {home} and {end} moves the cursor', () => {
"a{CURSOR}c" -> "abc{CURSOR}"
input[value="abc"] - select
input[value="abc"] - keyup: b (98)
input[value="abc"] - keydown: End (36)
input[value="abc"] - keydown: End (35)
input[value="abc"] - select
input[value="abc"] - keyup: End (36)
input[value="abc"] - keyup: End (35)
input[value="abc"] - keydown: d (100)
input[value="abc"] - keypress: d (100)
input[value="abcd"] - input
Expand Down
4 changes: 2 additions & 2 deletions src/keys/navigation-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import {setSelectionRangeIfNecessary} from '../utils'

const keys = {
Home: {
keyCode: 35,
keyCode: 36,
},
End: {
keyCode: 36,
keyCode: 35,
},
ArrowLeft: {
keyCode: 37,
Expand Down

0 comments on commit b6f961a

Please sign in to comment.