Skip to content

Commit

Permalink
fix: use non-deprecated keyboardEvent.code instead of keyboardEvent.k…
Browse files Browse the repository at this point in the history
…eycode.
  • Loading branch information
lucasnetau committed Oct 13, 2023
1 parent 6da23a2 commit 0881cff
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions src/js/form-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2037,21 +2037,38 @@ function FormBuilder(opts, element, $) {
if (e.keyCode == 87 || e.keyCode == 38) {
moveFieldUp(rowWrapper)
}
switch (event.code) {
case 'KeyW':
case 'ArrowUp':
moveFieldUp(rowWrapper)
break

if (e.keyCode == 83 || e.keyCode == 40) {
moveFieldDown(rowWrapper)
}
case 'KeyS':
case 'ArrowDown':
moveFieldDown(rowWrapper)
break

if (e.keyCode == 65 || e.keyCode == 37) {
moveFieldLeft()
}
case 'KeyA':
case 'ArrowLeft':
moveFieldLeft()
break

if (e.keyCode == 68 || e.keyCode == 39) {
moveFieldRight()
}

if (e.keyCode == 82) {
autoSizeRowColumns(rowWrapper, true)
case 'KeyD':
case 'ArrowRight':
moveFieldRight()
break

case 'KeyR':
autoSizeRowColumns(rowWrapper, true)
break
}

buildGridModeCurrentRowInfo()
Expand Down

0 comments on commit 0881cff

Please sign in to comment.