File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,12 @@ const Item: React.FC<ItemProps> = ({ item, primaryColor }) => {
63
63
< DisabledItem > { item . label } </ DisabledItem >
64
64
) : (
65
65
< li
66
+ tabIndex = { 0 }
67
+ onKeyDown = { ( e : React . KeyboardEvent < HTMLLIElement > ) => {
68
+ if ( e . key === ' ' || e . key === 'Enter' ) {
69
+ handleValueChange ( item )
70
+ }
71
+ } }
66
72
aria-selected = { isSelected }
67
73
role = { "option" }
68
74
onClick = { ( ) => handleValueChange ( item ) }
Original file line number Diff line number Diff line change @@ -178,7 +178,6 @@ const Select: React.FC<SelectProps> = ({
178
178
>
179
179
< div className = "relative w-full" ref = { ref } >
180
180
< div
181
- tabIndex = { 0 }
182
181
aria-expanded = { open }
183
182
onKeyDown = { onPressEnterOrSpace }
184
183
onClick = { toggle }
@@ -207,6 +206,8 @@ const Select: React.FC<SelectProps> = ({
207
206
</ p >
208
207
{ ! isDisabled && (
209
208
< div
209
+ role = "button"
210
+ tabIndex = { 0 }
210
211
onClick = { e => removeItem ( e , item ) }
211
212
className = {
212
213
classNames ?. tagItemIconContainer
@@ -264,7 +265,6 @@ const Select: React.FC<SelectProps> = ({
264
265
265
266
{ open && ! isDisabled && (
266
267
< div
267
- tabIndex = { - 1 }
268
268
className = {
269
269
classNames ?. menu
270
270
? classNames . menu
You can’t perform that action at this time.
0 commit comments