From 12c54fcdbb479aa62643f7698fa0a6f606f3016d Mon Sep 17 00:00:00 2001 From: Ali Akbar Azizi Date: Fri, 13 Oct 2023 19:47:18 +0330 Subject: [PATCH] fix: close action --- src/context/context.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/context/context.ts b/src/context/context.ts index c751101..4e3bbf7 100644 --- a/src/context/context.ts +++ b/src/context/context.ts @@ -378,16 +378,7 @@ function runAction( if (index === '') { index = - (['open', 'close', 'toggle'].includes(type) - ? Object.keys(state.pickers) - .reverse() - .find( - (key) => - state.pickers[key].nestedLevel === - (payload as any).nestedLevel + 1, - ) || '' - : (payload as any).pickerId) || - Object.keys(state.pickers).reverse()[0]; + (payload as any).pickerId || Object.keys(state.pickers).reverse()[0]; if (index === undefined) { throw new Error('There is no Picker in the current Provider'); @@ -395,7 +386,7 @@ function runAction( } } - console.log(type); + console.log(type, index, _match, Object.keys(state.pickers)); switch (type) { case 'open':