Skip to content

Commit 1543be1

Browse files
add "shouldFocusWrap" to useComboBoxProps (#2348)
1 parent f4315f3 commit 1543be1

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/@react-aria/combobox/src/useComboBox.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export function useComboBox<T>(props: AriaComboBoxProps<T>, state: ComboBoxState
6969
listBoxRef,
7070
keyboardDelegate,
7171
// completionMode = 'suggest',
72+
shouldFocusWrap,
7273
isReadOnly,
7374
isDisabled
7475
} = props;
@@ -98,6 +99,7 @@ export function useComboBox<T>(props: AriaComboBoxProps<T>, state: ComboBoxState
9899
keyboardDelegate: delegate,
99100
disallowTypeAhead: true,
100101
disallowEmptySelection: true,
102+
shouldFocusWrap,
101103
ref: inputRef,
102104
// Prevent item scroll behavior from being applied here, should be handled in the user's Popover + ListBox component
103105
isVirtualized: true

packages/@react-types/combobox/src/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ export interface ComboBoxProps<T> extends CollectionBase<T>, SingleSelection, In
3838
* The interaction required to display the ComboBox menu.
3939
* @default 'input'
4040
*/
41-
menuTrigger?: MenuTriggerAction
41+
menuTrigger?: MenuTriggerAction,
42+
/** Whether keyboard navigation is circular. */
43+
shouldFocusWrap?: boolean
4244
}
4345

4446
export interface SpectrumComboBoxProps<T> extends Omit<ComboBoxProps<T>, 'menuTrigger'>, SpectrumLabelableProps, StyleProps, Omit<AsyncLoadable, 'isLoading'> {

0 commit comments

Comments
 (0)