Skip to content

Commit

Permalink
Fix prop types for useListBox (adobe#1107)
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic authored Sep 30, 2020
1 parent 7fec7ff commit 61d8633
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions packages/@react-aria/listbox/src/useListBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface ListBoxAria {
labelProps: HTMLAttributes<HTMLElement>
}

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

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

return {
labelProps,
listBoxProps: mergeProps(domProps, {
listBoxProps: mergeProps(domProps, state.selectionManager.selectionMode === 'multiple' ? {
'aria-multiselectable': 'true'
} : {}, {
role: 'listbox',
'aria-multiselectable': state.selectionManager.selectionMode === 'multiple' ? 'true' : undefined,
...mergeProps(fieldProps, listProps)
})
};
Expand Down
1 change: 0 additions & 1 deletion packages/@react-spectrum/listbox/src/ListBoxBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export function useListBoxLayout<T>(state: ListState<T>) {
/** @private */
function ListBoxBase<T>(props: ListBoxBaseProps<T>, ref: RefObject<HTMLDivElement>) {
let {layout, state, shouldSelectOnPressUp, focusOnPointerEnter, shouldUseVirtualFocus, domProps = {}, transitionDuration = 0} = props;
// @ts-ignore
let {listBoxProps} = useListBox({
...props,
...domProps,
Expand Down

0 comments on commit 61d8633

Please sign in to comment.