Skip to content

Commit 61d8633

Browse files
authoredSep 30, 2020
Fix prop types for useListBox (adobe#1107)
1 parent 7fec7ff commit 61d8633

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎packages/@react-aria/listbox/src/useListBox.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface ListBoxAria {
2727
labelProps: HTMLAttributes<HTMLElement>
2828
}
2929

30-
interface AriaListBoxOptions<T> extends AriaListBoxProps<T> {
30+
interface AriaListBoxOptions<T> extends Omit<AriaListBoxProps<T>, 'children'> {
3131
/** Whether the listbox uses virtual scrolling. */
3232
isVirtualized?: boolean,
3333

@@ -72,9 +72,10 @@ export function useListBox<T>(props: AriaListBoxOptions<T>, state: ListState<T>,
7272

7373
return {
7474
labelProps,
75-
listBoxProps: mergeProps(domProps, {
75+
listBoxProps: mergeProps(domProps, state.selectionManager.selectionMode === 'multiple' ? {
76+
'aria-multiselectable': 'true'
77+
} : {}, {
7678
role: 'listbox',
77-
'aria-multiselectable': state.selectionManager.selectionMode === 'multiple' ? 'true' : undefined,
7879
...mergeProps(fieldProps, listProps)
7980
})
8081
};

‎packages/@react-spectrum/listbox/src/ListBoxBase.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export function useListBoxLayout<T>(state: ListState<T>) {
6565
/** @private */
6666
function ListBoxBase<T>(props: ListBoxBaseProps<T>, ref: RefObject<HTMLDivElement>) {
6767
let {layout, state, shouldSelectOnPressUp, focusOnPointerEnter, shouldUseVirtualFocus, domProps = {}, transitionDuration = 0} = props;
68-
// @ts-ignore
6968
let {listBoxProps} = useListBox({
7069
...props,
7170
...domProps,

0 commit comments

Comments
 (0)
Failed to load comments.