@@ -6,12 +6,12 @@ import usePlayground from '../hooks/usePlayground';
6
6
import state from '../lib/state' ;
7
7
import { eventMap } from '@testing-library/dom/dist/event-map' ;
8
8
import { VirtualScrollable } from './Scrollable' ;
9
- import { FixedSizeList as List } from 'react-window' ;
10
9
import throttle from 'lodash.throttle' ;
11
10
import AutoSizer from 'react-virtualized-auto-sizer' ;
12
11
import IconButton from './IconButton' ;
13
12
import TrashcanIcon from './TrashcanIcon' ;
14
13
import EmptyStreetImg from '../images/EmptyStreetImg' ;
14
+ import StickyList from './StickyList' ;
15
15
16
16
function onStateChange ( { markup, query, result } ) {
17
17
state . save ( { markup, query } ) ;
@@ -133,9 +133,8 @@ function DomEvents() {
133
133
if ( ! node ) return ;
134
134
135
135
addLoggingEvents ( node , ( event ) => {
136
- // insert at index 0
137
136
event . id = buffer . current . length ;
138
- buffer . current . splice ( 0 , 0 , event ) ;
137
+ buffer . current . push ( event ) ;
139
138
setTimeout ( flush , 0 ) ;
140
139
} ) ;
141
140
} , [ ] ) ;
@@ -185,7 +184,9 @@ function DomEvents() {
185
184
) : (
186
185
< AutoSizer >
187
186
{ ( { width, height } ) => (
188
- < List
187
+ < StickyList
188
+ follow = { true }
189
+ mode = "bottom"
189
190
ref = { listRef }
190
191
height = { height }
191
192
itemCount = { eventCount }
@@ -195,7 +196,7 @@ function DomEvents() {
195
196
outerElementType = { VirtualScrollable }
196
197
>
197
198
{ EventRecord }
198
- </ List >
199
+ </ StickyList >
199
200
) }
200
201
</ AutoSizer >
201
202
) }
0 commit comments