Skip to content

Commit 9026acb

Browse files
committed
get rid of extra todos and obsolte test
1 parent 875d9a3 commit 9026acb

File tree

7 files changed

+3
-24
lines changed

7 files changed

+3
-24
lines changed

packages/@react-aria/utils/src/useLoadMoreSentinel.ts

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export interface LoadMoreSentinelProps extends Omit<AsyncLoadable, 'isLoading'>
2626
* @default 1
2727
*/
2828
scrollOffset?: number
29-
// TODO: Maybe include a scrollRef option so the user can provide the scrollParent to compare against instead of having us look it up
3029
}
3130

3231
export function UNSTABLE_useLoadMoreSentinel(props: LoadMoreSentinelProps, ref: RefObject<HTMLElement | null>): void {

packages/@react-spectrum/s2/chromatic/Combobox.stories.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ export const WithEmptyState = {
8383
}
8484
};
8585

86-
// TODO: this one is probably not great for chromatic since it has the spinner, check if ignoreSelectors works for it
8786
export const WithInitialLoading = {
8887
...EmptyCombobox,
8988
args: {

packages/react-aria-components/src/GridList.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ export const UNSTABLE_GridListLoadingSentinel = createLeafComponent('loader', fu
532532

533533
return (
534534
<>
535-
{/* TODO: Alway render the sentinel. Will need to figure out how best to position this in cases where the user is using flex + gap (this would introduce a gap even though it doesn't take room) */}
535+
{/* Alway render the sentinel. For now onus is on the user for styling when using flex + gap (this would introduce a gap even though it doesn't take room) */}
536536
{/* @ts-ignore - compatibility with React < 19 */}
537537
<div style={{position: 'relative', width: 0, height: 0}} inert={inertValue(true)} >
538538
<div data-testid="loadMoreSentinel" ref={sentinelRef} style={{position: 'absolute', height: 1, width: 1}} />

packages/react-aria-components/src/ListBox.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ export const UNSTABLE_ListBoxLoadingSentinel = createLeafComponent('loader', fun
509509

510510
return (
511511
<>
512-
{/* TODO: Alway render the sentinel. Will need to figure out how best to position this in cases where the user is using flex + gap (this would introduce a gap even though it doesn't take room) */}
512+
{/* Alway render the sentinel. For now onus is on the user for styling when using flex + gap (this would introduce a gap even though it doesn't take room) */}
513513
{/* @ts-ignore - compatibility with React < 19 */}
514514
<div style={{position: 'relative', width: 0, height: 0}} inert={inertValue(true)} >
515515
<div data-testid="loadMoreSentinel" ref={sentinelRef} style={{position: 'absolute', height: 1, width: 1}} />

packages/react-aria-components/src/Table.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1397,8 +1397,7 @@ export const UNSTABLE_TableLoadingSentinel = createLeafComponent('loader', funct
13971397

13981398
return (
13991399
<>
1400-
{/* TODO weird structure? Renders a extra row but we hide via inert so maybe ok? */}
1401-
{/* TODO: Will need to figure out how best to position this in cases where the user is using flex + gap (this would introduce a gap even though it doesn't take room) */}
1400+
{/* Alway render the sentinel. For now onus is on the user for styling when using flex + gap (this would introduce a gap even though it doesn't take room) */}
14021401
{/* @ts-ignore - compatibility with React < 19 */}
14031402
<TR style={{position: 'relative', width: 0, height: 0}} inert={inertValue(true)} >
14041403
<TD data-testid="loadMoreSentinel" ref={sentinelRef} style={{position: 'absolute', height: 1, width: 1}} />

packages/react-aria-components/stories/Table.stories.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,6 @@ function VirtualizedTableWithEmptyState(args) {
844844
<MyColumn>Baz</MyColumn>
845845
</TableHeader>
846846
<MyTableBody
847-
// TODO: adjust this as well
848847
isLoading={args.isLoading}
849848
renderEmptyState={() => renderEmptyLoader({isLoading: !args.showRows && args.isLoading})}
850849
rows={!args.showRows ? [] : rows}>

packages/react-aria-components/test/Table.test.js

-17
Original file line numberDiff line numberDiff line change
@@ -2003,23 +2003,6 @@ describe('Table', () => {
20032003
expect(onLoadMore).toHaveBeenCalledTimes(1);
20042004
});
20052005

2006-
// TODO: decide if we want to allow customization for this (I assume we will)
2007-
it.skip('allows the user to customize the scrollOffset required to trigger onLoadMore', function () {
2008-
jest.spyOn(window.HTMLElement.prototype, 'scrollHeight', 'get').mockImplementation(() => 100);
2009-
jest.spyOn(window.HTMLElement.prototype, 'clientHeight', 'get').mockImplementation(() => 25);
2010-
2011-
let tree = render(<LoadMoreTable onLoadMore={onLoadMore} scrollOffset={2} />);
2012-
2013-
let scrollView = tree.getByTestId('scrollRegion');
2014-
expect(onLoadMore).toHaveBeenCalledTimes(0);
2015-
2016-
scrollView.scrollTop = 50;
2017-
fireEvent.scroll(scrollView);
2018-
act(() => {jest.runAllTimers();});
2019-
2020-
expect(onLoadMore).toHaveBeenCalledTimes(1);
2021-
});
2022-
20232006
describe('virtualized', () => {
20242007
let items = [];
20252008
for (let i = 1; i <= 50; i++) {

0 commit comments

Comments
 (0)