File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
packages/core/src/Listbox Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,23 @@ const isClickFocus = refAutoReset(false, 10)
34
34
return
35
35
rootContext.onEnter(ev)
36
36
}"
37
- @keydown.down.up.left.right.home.end.prevent =" (event) => {
37
+ @keydown.down.up.left.right.home.end =" (event: KeyboardEvent) => {
38
+ if (
39
+ // when orientation is vertical, ignore left/right
40
+ (
41
+ rootContext.orientation.value === 'vertical'
42
+ && (event.key === 'ArrowLeft' || event.key === 'ArrowRight')
43
+ )
44
+ // when orientation is horizontal, ignore up/down
45
+ || (
46
+ rootContext.orientation.value === 'horizontal'
47
+ && (event.key === 'ArrowUp' || event.key === 'ArrowDown')
48
+ )
49
+ ) {
50
+ return
51
+ }
52
+
53
+ event.preventDefault()
38
54
rootContext.focusable.value ? rootContext.onKeydownNavigation(event) : undefined
39
55
}"
40
56
@keydown.enter =" rootContext.onKeydownEnter"
You can’t perform that action at this time.
0 commit comments