Skip to content

Commit 57ace66

Browse files
Copilotposva
andcommitted
fix: enforce minimum height when reading devtools height from localStorage
Co-authored-by: posva <664177+posva@users.noreply.github.com>
1 parent 48bf282 commit 57ace66

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎devtools/src/panel/components/PiPContainer.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ const colorTheme = computed(() => {
1717
1818
const pipContainerHeight = useLocalStorage('pinia-colada-devtools-pip-container-height', 400)
1919
20-
// ensure the height it less than 80% of the screen height
21-
pipContainerHeight.value = Math.min(pipContainerHeight.value, window.innerHeight * 0.8)
20+
// ensure the height is between 20% and 80% of the screen height
21+
pipContainerHeight.value = Math.min(Math.max(pipContainerHeight.value, window.innerHeight * 0.2), window.innerHeight * 0.8)
2222
2323
// TODO: refactor into CSS v-bind
2424
const containerStyle = computed(() => ({ height: `${pipContainerHeight.value}px` }))

0 commit comments

Comments
 (0)