Skip to content

Commit

Permalink
fix extra pane sometimes having 0 widht
Browse files Browse the repository at this point in the history
  • Loading branch information
iximiuz committed Oct 9, 2023
1 parent ee7bd2b commit d5a8f66
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ui/src/components/GraphScreenExtraPane.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ const showed = computed(() => !!appStore.inspectedKubeObject);
watch(showed, (showed) => {
if (showed) {
if (width.value === 0) {
if (width.value < minWidth) {
width.value = Math.max(minWidth, props.maxWidth / 3); // 1/3 of the screen's main pane width unless it's too small
}
if (width.value > props.maxWidth) {
width.value = props.maxWidth;
// Seems like sometimes maxWidth can be 0... Probably when the real screen size is not known upon the component's mount
width.value = Math.max(minWidth, props.maxWidth);
}
containerRef.value.style["flex-basis"] = width.value + "px";
} else {
Expand Down

0 comments on commit d5a8f66

Please sign in to comment.