You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Load more collection element support in RAC Table and Tree (#6494)
* rough approach for having user provide loading element to rac collection element
* bare minimum for table loader support
* add first and last row/cell data-attributes
* updating collection to auto propagate dependencies and debugging example stories
* adding stories for empty state + loading variations in tree and table
* updating verdaccio to not crash on newer macbooks
* rip out first/last row and fix lint
* add TableLoader to index so that I can test in s2
* add isTableEmpty and colspan for table loader
also some debugging of crashes
* add renderProps to loader
* omit loader from the collection size in table
* fix bugs with keyboard navigation and load more in table
* Fix Tree keyboard nav issues and add tests
* fix keyboard nav with loaders via keyboard delegate item filtering logic
it makes more sense for the keyboard delegate to handle what keys should be returned on up/down/pageUp/etc
* clean up and use hook for loader row attributes
* refactor so that empty load more is expected to be a part of renderEmptyState
* useLoadMore support in RAC Table (#6538)
* initial implementation of load more hook
* initial stab at scrollable body table
* fix lint and readd content height change check
* update attributes and test virtualizer + loadmore
* remove option in prep for fix
* fix for loadMore and update virtualized RAC table stories
* get rid of loaderHeight option
* move hook to separate package
* add tests
* fix some stuff from rebase
* fix test for 16/17
* refactor useLoadOnScroll so it can replace useVirtualizer internals
* inconsistent 19 test is fixed now
* fix another 19 test
* fix crash when dragging over loading spinner
* only render loadmore spinner in dnd table if there are items
* get rid of todo now that layout has been refactored
* move logic to render after drop indicator when row is before logic into Collection
* move useLoadMore to util package for now
punting refactor and removal of virtualizer to later see note
* pull loadmore hook out of rac table
* rename loader collection element and update layout for variable loader height
* forgot to remove deps
* fix esm test?
* update useloadmore logic and replace useVirtualizer internals
note this removes the "wasLoading || ref.current.scrollHeight !== lastContentSize.current" portion of the logic. Previously useVirtualizer onVisibleRectChange was the one that would handle loading more items if opening a combobox dropdown during/after initial load, not the layouteffect. However, now that that is replaced by useLoadMore onScroll handler, we need the layouteffect to handle that
* remove useVirtualizer
* fix tests
* fix erroneous conditional hooks call
was causing a different order of hooks calls when a table with renderEmptyState went from empty to having a rows
* review comments and updating Tree loader naming for consistency
* dont apply width directly on columnheader if virtualizer
fix for S2, the wrapper around the columnheader already has the calculated width applied on it so we dont need it on the columnheader as well. This makes padding values applied on the columnheader take up room from current width instead of making the columnheader extra wide
* fix lint
* add items check to useLoadMore
interim fix to prevent some extra onLoadMore calls. RAC will eventually make use of the collection when the hook is moved inside the component whereas RSP table cant benefit from this since its collection is always rebuilt and thus non stable. Items are also provided to the TableBody and cant be accessed from with tablevirtualizer
* add display contents and debug sticky loader
* clean up from review
* test and story updates from review comments
---------
Co-authored-by: Devon Govett <[email protected]>
Copy file name to clipboardExpand all lines: packages/@react-aria/dnd/src/ListDropTargetDelegate.ts
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,11 @@ export class ListDropTargetDelegate implements DropTargetDelegate {
95
95
}
96
96
}
97
97
98
-
letitems=[...this.collection];
98
+
// TODO: assume that only item type items are valid drop targets. This is to prevent a crash when dragging over the loader
99
+
// row since it doesn't have a data-key set on it. Will eventually need to handle the case with drag and drop and loaders located between rows aka tree.
100
+
// Can see https://github.com/adobe/react-spectrum/pull/4210/files#diff-21e555e0c597a28215e36137f5be076a65a1e1456c92cd0fdd60f866929aae2a for additional logic
0 commit comments