Skip to content

Commit

Permalink
improve collapse behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
leire committed Jun 17, 2024
1 parent 31d8884 commit a9e2d7b
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,9 @@ export default {
this.debounce.stop();
const savedPosition = this.getPosition();
if (this.isExpanded) {
const useSavedPosition =
this.parentHeight - parseInt(savedPosition?.position) >
this.expandedPanelMinHeight;
this.upSide.style.height = useSavedPosition
? savedPosition?.position
: "50%";
if (this.resizing) {
this.upSide.style.height = savedPosition?.position;
}
} else {
this.upSide.style.height = "100%";
}
Expand Down Expand Up @@ -150,6 +147,15 @@ export default {
},
toggleExpand() {
this.isExpanded = !this.isExpanded;
if (this.isExpanded) {
const savedPosition = this.getPosition();
const useSavedPosition =
this.parentHeight - parseInt(savedPosition?.position) >
this.expandedPanelMinHeight;
this.upSide.style.height = useSavedPosition
? savedPosition?.position
: "50%";
}
},
},
setup(props) {
Expand Down

0 comments on commit a9e2d7b

Please sign in to comment.