|
10 | 10 | * governing permissions and limitations under the License.
|
11 | 11 | */
|
12 | 12 |
|
13 |
| -import {AriaListBoxOptions, AriaListBoxProps, DraggableItemResult, DragPreviewRenderer, DroppableCollectionResult, DroppableItemResult, FocusScope, ListKeyboardDelegate, mergeProps, useFocusRing, useHover, useListBox, useListBoxSection, useLocale, useOption} from 'react-aria'; |
| 13 | +import {AriaListBoxOptions, AriaListBoxProps, DraggableItemResult, DragPreviewRenderer, DroppableCollectionResult, DroppableItemResult, FocusScope, ListKeyboardDelegate, mergeProps, useCollator, useFocusRing, useHover, useListBox, useListBoxSection, useLocale, useOption} from 'react-aria'; |
14 | 14 | import {CollectionDocumentContext, CollectionPortal, CollectionProps, ItemProps, useCachedChildren, useCollection} from './Collection';
|
15 | 15 | import {ContextValue, forwardRefType, HiddenContext, Provider, SlotProps, StyleProps, StyleRenderProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';
|
16 | 16 | import {DragAndDropContext, DragAndDropHooks, DropIndicator, DropIndicatorContext, DropIndicatorProps} from './useDragAndDrop';
|
@@ -130,16 +130,18 @@ function ListBoxInner<T>({state, props, listBoxRef}: ListBoxInnerProps<T>) {
|
130 | 130 | let isListDroppable = !!dragAndDropHooks?.useDroppableCollectionState;
|
131 | 131 | let {direction} = useLocale();
|
132 | 132 | let {disabledBehavior, disabledKeys} = selectionManager;
|
| 133 | + let collator = useCollator({usage: 'search', sensitivity: 'base'}); |
133 | 134 | let keyboardDelegate = useMemo(() => (
|
134 | 135 | props.keyboardDelegate || new ListKeyboardDelegate({
|
135 | 136 | collection,
|
| 137 | + collator, |
136 | 138 | ref: listBoxRef,
|
137 | 139 | disabledKeys: disabledBehavior === 'selection' ? new Set<React.Key>() : disabledKeys,
|
138 | 140 | layout,
|
139 | 141 | orientation,
|
140 | 142 | direction
|
141 | 143 | })
|
142 |
| - ), [collection, listBoxRef, disabledBehavior, disabledKeys, orientation, direction, props.keyboardDelegate, layout]); |
| 144 | + ), [collection, collator, listBoxRef, disabledBehavior, disabledKeys, orientation, direction, props.keyboardDelegate, layout]); |
143 | 145 |
|
144 | 146 | let {listBoxProps} = useListBox({
|
145 | 147 | ...props,
|
|
0 commit comments