diff --git a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/VideoSourceWidget/__snapshots__/index.test.jsx.snap b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/VideoSourceWidget/__snapshots__/index.test.jsx.snap index b5129af5b..86e0d3e1e 100644 --- a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/VideoSourceWidget/__snapshots__/index.test.jsx.snap +++ b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/VideoSourceWidget/__snapshots__/index.test.jsx.snap @@ -82,7 +82,6 @@ exports[`VideoSourceWidget snapshots snapshots: renders as expected with default ({ export const fallbackHooks = ({ fallbackVideos, dispatch }) => ({ addFallbackVideo: () => dispatch(actions.video.updateField({ fallbackVideos: [...fallbackVideos, ''] })), - deleteFallbackVideo: (videoUrl) => { - const updatedFallbackVideos = fallbackVideos.splice(fallbackVideos.indexOf(videoUrl), 1); + + deleteFallbackVideo: (videoIndex) => { + const updatedFallbackVideos = fallbackVideos.reduce((result, currentItem, index) => { + if (index === videoIndex) { return result; } + return [...result, currentItem]; + }, []); + dispatch(actions.video.updateField({ fallbackVideos: updatedFallbackVideos })); }, }); diff --git a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/VideoSourceWidget/index.jsx b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/VideoSourceWidget/index.jsx index bd6459d75..6da54bde4 100644 --- a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/VideoSourceWidget/index.jsx +++ b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/VideoSourceWidget/index.jsx @@ -105,13 +105,12 @@ export const VideoSourceWidget = ({ onBlur={fallbackVideos.onBlur(index)} /> deleteFallbackVideo(videoUrl)} + onClick={() => deleteFallbackVideo(index)} /> )) : null}