Skip to content

Commit

Permalink
fix: close action
Browse files Browse the repository at this point in the history
  • Loading branch information
aliakbarazizi committed Oct 13, 2023
1 parent deea015 commit 12c54fc
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/context/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,24 +378,15 @@ 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');
}
}
}

console.log(type);
console.log(type, index, _match, Object.keys(state.pickers));

switch (type) {
case 'open':
Expand Down

0 comments on commit 12c54fc

Please sign in to comment.