File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
react-devtools-shared/src/devtools/views
react-devtools-timeline/src Expand file tree Collapse file tree 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({
7575 ownerDocument . addEventListener ( 'keydown' , handleKeyDown ) ;
7676
7777 return ( ) => ownerDocument . removeEventListener ( 'keydown' , handleKeyDown ) ;
78- } , [ inputRef ] ) ;
78+ } , [ ] ) ;
7979
8080 return (
8181 < div className = { styles . SearchInput } >
Original file line number Diff line number Diff line change @@ -175,16 +175,19 @@ function AutoSizedCanvas({
175175 TimelineSearchContext ,
176176 ) ;
177177
178+ // This effect searches timeline data and scrolls to the next match wen search criteria change.
178179 useLayoutEffect ( ( ) => {
179180 viewState . updateSearchRegExpState ( searchRegExp ) ;
180181
181- const componentMeasure =
182+ const componentMeasureSearchResult =
182183 searchResults . length > 0 ? searchResults [ searchIndex ] : null ;
183- if ( componentMeasure != null ) {
184+ if ( componentMeasureSearchResult != null ) {
184185 const scrollState = moveStateToRange ( {
185186 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 ,
188191 contentLength : data . duration ,
189192 minContentLength : data . duration * MIN_ZOOM_LEVEL ,
190193 maxContentLength : data . duration * MAX_ZOOM_LEVEL ,
You can’t perform that action at this time.
0 commit comments