-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: nested collection support #7379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
83ab27d
642d6ae
9f24163
10a3290
ab327ca
e78c176
4e3d68e
8e9dfb8
060673c
90acf6c
aab8a0c
c814b48
aad0e44
466e4f0
aede6fc
7cbb3ad
f90758f
e04da95
d25b5ca
c0c33a8
0f6a1f2
22964a3
2ce6172
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,11 @@ export interface GridListRenderProps { | |
} | ||
|
||
export interface GridListProps<T> extends Omit<AriaGridListProps<T>, 'children'>, CollectionProps<T>, StyleRenderProps<GridListRenderProps>, SlotProps, ScrollableProps<HTMLDivElement> { | ||
/** | ||
* Whether typeahead navigation is disabled. | ||
* @default false | ||
*/ | ||
disallowTypeAhead?: boolean, | ||
/** How multiple selection should behave in the collection. */ | ||
selectionBehavior?: SelectionBehavior, | ||
/** The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the GridList. */ | ||
|
@@ -120,7 +125,7 @@ function GridListInner<T extends object>({props, collection, gridListRef: ref}: | |
}) | ||
), [collection, ref, layout, disabledKeys, disabledBehavior, layoutDelegate, collator, direction]); | ||
|
||
let {gridProps} = useGridList({ | ||
let {gridProps: {id, ...gridProps}} = useGridList({ | ||
...props, | ||
keyboardDelegate, | ||
// Only tab navigation is supported in grid layout. | ||
|
@@ -218,7 +223,7 @@ function GridListInner<T extends object>({props, collection, gridListRef: ref}: | |
<div | ||
{...filterDOMProps(props)} | ||
{...renderProps} | ||
{...mergeProps(gridProps, focusProps, droppableCollection?.collectionProps, emptyStatePropOverrides)} | ||
{...mergeProps(gridProps, focusProps, droppableCollection?.collectionProps, emptyStatePropOverrides, {id})} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what happened here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This addresses two issues. The first is #7655, which we scheduled as a follow-up to this PR but has since landed. Second is that drag & drop hooks generate their own id without a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm does the latter case still occur? I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right. @LFDanLu and I just agreed it would be better to hand the id down to gridlists call to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will just push that as follow-up once i get into the office tomorrow 👍 |
||
ref={ref} | ||
slot={props.slot || undefined} | ||
onScroll={props.onScroll} | ||
|
Uh oh!
There was an error while loading. Please reload this page.