Skip to content

Commit

Permalink
Update LogViewerSearch.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
tevko authored Sep 26, 2024
1 parent 1bf71d0 commit e2337ec
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/module/src/LogViewer/LogViewerSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ export interface LogViewerSearchProps extends SearchInputProps {
/** Minimum number of characters required for searching */
minSearchChars: number;
ref: any;
parentSearchCB: any;
}

export const LogViewerSearch: React.FunctionComponent<LogViewerSearchProps> = forwardRef(({
placeholder = 'Search',
minSearchChars = 1,
parentSearchCB,
...props
}, ref) => {
const [indexAdjuster, setIndexAdjuster] = useState(0);
Expand All @@ -47,7 +45,7 @@ export const LogViewerSearch: React.FunctionComponent<LogViewerSearchProps> = fo
setSearchedInput(input)
},
hasFoundResults: searchedWordIndexes?.length > 0 && searchedWordIndexes[0]?.rowIndex !== -1,

searchedInput,
}));

/* Defaulting the first focused row that contain searched keywords */
Expand Down Expand Up @@ -87,9 +85,6 @@ export const LogViewerSearch: React.FunctionComponent<LogViewerSearchProps> = fo
setCurrentSearchedItemCount(DEFAULT_INDEX);
setSearchedWordIndexes([]);
setRowInFocus(defaultRowInFocus);
if (parentSearchCB) {
parentSearchCB();
}
};

/* Moving focus over to next row containing searched word */
Expand Down

0 comments on commit e2337ec

Please sign in to comment.