Skip to content

Commit

Permalink
fix: fix lost open animation of collapse (#827)
Browse files Browse the repository at this point in the history
  • Loading branch information
mortalYoung authored Nov 21, 2022
1 parent 0b71d12 commit d1cdbe1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/components/collapse/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function Collapse({
const adjustedSize = useRef<number[]>([]);
const first = useRef(true);

const isUndefined = (key): boolean => {
const isUndefined = (key: UniqueId): boolean => {
return key === undefined;
};

Expand Down Expand Up @@ -125,7 +125,7 @@ export function Collapse({
return null;
};

const handleChangeCallback = (key: UniqueId, index) => {
const handleChangeCallback = (key: UniqueId, index: number) => {
const currentKeys = [...activePanelKeys];
if (!isUndefined(currentKeys[index])) {
delete currentKeys[index];
Expand Down
16 changes: 6 additions & 10 deletions src/components/collapse/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ $split_pane_visible: #{$split}__pane__item--visible;
}

&__pane {
&--collapsing {
transition: top ease-in-out 0.2s, height ease-in-out 0.2s;
}
transition: top ease-out 0.15s, height ease-out 0.15s;

&:not(#{$split_pane_visible} ~ #{$split_pane_visible}) {
#{$collapse}__header {
border-top: 0;
}
&:first-child #{$collapse}__header {
border-top-color: transparent;
}
}

Expand All @@ -43,14 +39,14 @@ $split_pane_visible: #{$split}__pane__item--visible;

&__header {
align-items: center;
border-top: 1px solid var(--sideBarSectionHeader-border);
border-bottom: 1px solid transparent;
border-top: 1px solid var(--sideBarSectionHeader-border, transparent);
box-sizing: border-box;
cursor: pointer;
display: flex;
font-size: 11px;
font-weight: bold;
height: 25px;
outline: none;
height: 26px;
outline: 1px solid transparent;
outline-offset: -1px;
padding: 1px 2px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
"scrollbar.shadow": "#00000000",
"quickInputList.focusBackground": "#e7e6e5",
"quickInputList.focusForeground": "#24292e",
"list.focusOutline": "#ffffff",
"list.highlightForeground": "#0066BF",
"list.focusHighlightForeground": "#0066BF",

"terminal.background": "#ffffff",
"terminal.foreground": "#333333",
"terminal.ansiBlack": "#414141",
Expand Down

0 comments on commit d1cdbe1

Please sign in to comment.