File tree 2 files changed +8
-5
lines changed
react-devtools-shared/src/devtools/views
react-devtools-timeline/src
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ export default function SearchInput({
75
75
ownerDocument . addEventListener ( 'keydown' , handleKeyDown ) ;
76
76
77
77
return ( ) => ownerDocument . removeEventListener ( 'keydown' , handleKeyDown ) ;
78
- } , [ inputRef ] ) ;
78
+ } , [ ] ) ;
79
79
80
80
return (
81
81
< div className = { styles . SearchInput } >
Original file line number Diff line number Diff line change @@ -175,16 +175,19 @@ function AutoSizedCanvas({
175
175
TimelineSearchContext ,
176
176
) ;
177
177
178
+ // This effect searches timeline data and scrolls to the next match wen search criteria change.
178
179
useLayoutEffect ( ( ) => {
179
180
viewState . updateSearchRegExpState ( searchRegExp ) ;
180
181
181
- const componentMeasure =
182
+ const componentMeasureSearchResult =
182
183
searchResults . length > 0 ? searchResults [ searchIndex ] : null ;
183
- if ( componentMeasure != null ) {
184
+ if ( componentMeasureSearchResult != null ) {
184
185
const scrollState = moveStateToRange ( {
185
186
state : viewState . horizontalScrollState ,
186
- rangeStart : componentMeasure . timestamp ,
187
- rangeEnd : componentMeasure . timestamp + componentMeasure . duration ,
187
+ rangeStart : componentMeasureSearchResult . timestamp ,
188
+ rangeEnd :
189
+ componentMeasureSearchResult . timestamp +
190
+ componentMeasureSearchResult . duration ,
188
191
contentLength : data . duration ,
189
192
minContentLength : data . duration * MIN_ZOOM_LEVEL ,
190
193
maxContentLength : data . duration * MAX_ZOOM_LEVEL ,
You can’t perform that action at this time.
0 commit comments