Merge pull request #10108 from Budibase/fix/allow-arrow-key-navigation
allow arrow key navigation in the components panel
This commit is contained in:
commit
1881eebb5e
1 changed files with 3 additions and 2 deletions
|
@ -182,12 +182,13 @@
|
|||
}
|
||||
|
||||
const handleKeyDown = e => {
|
||||
if (e.key === "Tab") {
|
||||
if (e.key === "Tab" || e.key === "ArrowDown" || e.key === "ArrowUp") {
|
||||
// Cycle selected components on tab press
|
||||
if (selectedIndex == null) {
|
||||
selectedIndex = 0
|
||||
} else {
|
||||
selectedIndex = (selectedIndex + 1) % componentList.length
|
||||
const direction = e.key === "ArrowUp" ? -1 : 1
|
||||
selectedIndex = (selectedIndex + direction) % componentList.length
|
||||
}
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
|
Loading…
Reference in a new issue