From edc147b6f4f802a55c39787f1873677b90c98072 Mon Sep 17 00:00:00 2001 From: Corey Robertson Date: Mon, 13 Sep 2021 13:18:25 -0400 Subject: [PATCH] Fixes issue with removing first workpad page (#110495) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- x-pack/plugins/canvas/public/state/reducers/pages.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/canvas/public/state/reducers/pages.js b/x-pack/plugins/canvas/public/state/reducers/pages.js index 78ec0addd970e..1565e73da91bd 100644 --- a/x-pack/plugins/canvas/public/state/reducers/pages.js +++ b/x-pack/plugins/canvas/public/state/reducers/pages.js @@ -123,7 +123,7 @@ export const pagesReducer = handleActions( newState = addPage(newState); } - if (wasOnlyPage) { + if (wasOnlyPage || curIndex === 0) { newState = set(newState, 'page', 0); gotoPage(1); } else if (wasSelected || delIndex < curIndex) {