@@ -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 } ) ;
@@ -137,9 +137,8 @@ function DomEvents() {
137
137
if ( node ) {
138
138
previewRef . current = node ;
139
139
const eventListeners = addLoggingEvents ( node , ( event ) => {
140
- // insert at index 0
141
140
event . id = buffer . current . length ;
142
- buffer . current . splice ( 0 , 0 , event ) ;
141
+ buffer . current . push ( event ) ;
143
142
setTimeout ( flush , 0 ) ;
144
143
} ) ;
145
144
setEventListeners ( eventListeners ) ;
@@ -196,7 +195,9 @@ function DomEvents() {
196
195
) : (
197
196
< AutoSizer >
198
197
{ ( { width, height } ) => (
199
- < List
198
+ < StickyList
199
+ follow = { true }
200
+ mode = "bottom"
200
201
ref = { listRef }
201
202
height = { height }
202
203
itemCount = { eventCount }
@@ -206,7 +207,7 @@ function DomEvents() {
206
207
outerElementType = { VirtualScrollable }
207
208
>
208
209
{ EventRecord }
209
- </ List >
210
+ </ StickyList >
210
211
) }
211
212
</ AutoSizer >
212
213
) }
0 commit comments