-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Select] Create options onPaste event #162
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './grouping'; | ||
export * from './options'; | ||
export * from './useWidth'; | ||
export * from './keyboard'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
export const keyNameToCode = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added this mapping to keep readability for
I think this more friendly format instead array of numbers (key codes) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't really need this with https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is works for Keyboard events (manually filling) but didn't work on paste due to ClipboardEvent (another way to interact with input needs a little bit different handler) |
||
Backspace: 8, | ||
Tab: 9, | ||
Enter: 13, | ||
Shift: 16, | ||
Ctrl: 17, | ||
Alt: 18, | ||
'Pause/Break': 19, | ||
'Caps Lock': 20, | ||
Esc: 27, | ||
Space: 32, | ||
'Page Up': 33, | ||
'Page Down': 34, | ||
End: 35, | ||
Home: 36, | ||
Left: 37, | ||
Up: 38, | ||
Right: 39, | ||
Down: 40, | ||
Insert: 45, | ||
Delete: 46, | ||
'0': 48, | ||
'1': 49, | ||
'2': 50, | ||
'3': 51, | ||
'4': 52, | ||
'5': 53, | ||
'6': 54, | ||
'7': 55, | ||
'8': 56, | ||
'9': 57, | ||
A: 65, | ||
B: 66, | ||
C: 67, | ||
D: 68, | ||
E: 69, | ||
F: 70, | ||
G: 71, | ||
H: 72, | ||
I: 73, | ||
J: 74, | ||
K: 75, | ||
L: 76, | ||
M: 77, | ||
N: 78, | ||
O: 79, | ||
P: 80, | ||
Q: 81, | ||
R: 82, | ||
S: 83, | ||
T: 84, | ||
U: 85, | ||
V: 86, | ||
W: 87, | ||
X: 88, | ||
Y: 89, | ||
Z: 90, | ||
Windows: 91, | ||
'Right Click': 93, | ||
'Numpad 0': 96, | ||
'Numpad 1': 97, | ||
'Numpad 2': 98, | ||
'Numpad 3': 99, | ||
'Numpad 4': 100, | ||
'Numpad 5': 101, | ||
'Numpad 6': 102, | ||
'Numpad 7': 103, | ||
'Numpad 8': 104, | ||
'Numpad 9': 105, | ||
'Numpad *': 106, | ||
'Numpad +': 107, | ||
'Numpad -': 109, | ||
'Numpad .': 110, | ||
'Numpad /': 111, | ||
F1: 112, | ||
F2: 113, | ||
F3: 114, | ||
F4: 115, | ||
F5: 116, | ||
F6: 117, | ||
F7: 118, | ||
F8: 119, | ||
F9: 120, | ||
F10: 121, | ||
F11: 122, | ||
F12: 123, | ||
'Num Lock': 144, | ||
'Scroll Lock': 145, | ||
'My Computer': 182, | ||
'My Calculator': 183, | ||
';': 186, | ||
'=': 187, | ||
',': 188, | ||
'-': 189, | ||
'.': 190, | ||
'/': 191, | ||
'`': 192, | ||
'[': 219, | ||
'\\': 220, | ||
']': 221, | ||
"'": 222 | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it select if its already a 'created' option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if creatable = false but I paste in a option this condition is invalid. I think it should be
selectOnPaste
then when combined w/creatable
would create them or of not just select them.