From 8e4d752e312595f3336bed57b4443c3cb1b3ece4 Mon Sep 17 00:00:00 2001 From: Konstantin Schaper Date: Mon, 27 Nov 2023 09:25:02 +0100 Subject: [PATCH] Fix e2e tests breaking because of modern javascript api usage --- scm-ui/ui-webapp/src/search/search-box/SearchBox.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 9b958f7517..e7d82880b2 100644 --- a/scm-ui/ui-webapp/src/search/search-box/SearchBox.tsx +++ b/scm-ui/ui-webapp/src/search/search-box/SearchBox.tsx @@ -77,8 +77,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; }), [] );