Skip to content

Commit

Permalink
fix: support removing more than one pane at a time (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwalley authored Jun 6, 2022
1 parent 76954bf commit 8b3b444
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/allotment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,13 @@ const Allotment = forwardRef<AllotmentHandle, AllotmentProps>(
const update = keys.filter((key) => previousKeys.current.includes(key));
const exit = previousKeys.current.map((key) => !keys.includes(key));

exit.forEach((flag, index) => {
if (flag) {
for (let index = exit.length - 1; index >= 0; index--) {
if (exit[index]) {
splitViewRef.current?.removeView(index);
panes.splice(index, 1);
views.current.splice(index, 1);
}
});
}

for (const enterKey of enter) {
const props = splitViewPropsRef.current.get(enterKey);
Expand Down

0 comments on commit 8b3b444

Please sign in to comment.