diff --git a/scm-ui/ui-webapp/src/search/search-box/SearchBox.tsx b/scm-ui/ui-webapp/src/search/search-box/SearchBox.tsx index 2b1fe1b277..5c0e7a5b90 100644 --- a/scm-ui/ui-webapp/src/search/search-box/SearchBox.tsx +++ b/scm-ui/ui-webapp/src/search/search-box/SearchBox.tsx @@ -75,8 +75,9 @@ const SearchBox = React.forwardRef< if (indexToInsert === -1) { indexToInsert = 0; } - // @ts-ignore toSpliced is part of modern browser api - return prev.toSpliced(indexToInsert, 0, ref); + const result = prev.slice(); + result.splice(indexToInsert, 0, ref); + return result; }), [] );