fix: Cannot set custom method #3406 (#3408)

* fix: #3406

* chore: remove console log

* fix: an unknown keyboard event issue

---------

Co-authored-by: Liyas Thomas <liyascthomas@gmail.com>
Co-authored-by: Anwarul Islam <anwaarulislaam@gmail.com>
This commit is contained in:
Rakibul Yeasin
2023-10-06 12:27:26 +06:00
committed by GitHub
parent 40f72278a9
commit 17d6ae15a5
2 changed files with 3 additions and 2 deletions

View File

@@ -426,7 +426,7 @@ const updateMethod = (method: string) => {
const onSelectMethod = (e: Event | any) => {
// type any because of value property not being recognized by TS in the event.target object. It is a valid property though.
updateMethod(e.value)
updateMethod(e.target.value)
}
const clearContent = () => {

View File

@@ -131,7 +131,8 @@ function generateKeybindingString(ev: KeyboardEvent): ShortcutKey | null {
}
function getPressedKey(ev: KeyboardEvent): Key | null {
const val = ev.code.toLowerCase()
// Sometimes the property code is not available on the KeyboardEvent object
const val = (ev.code ?? "").toLowerCase()
// Check arrow keys
if (val === "arrowup") return "up"