Skip to content

Commit b6d1154

Browse files
committed
refactor: Use css variable for overlay container height instead of inline style (resolves #838)
1 parent 0329055 commit b6d1154

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/VueDatePicker/components/Common/SelectionOverlay.vue

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
@keydown.down.prevent="handleArrowKey($event)"
1212
@keydown.right.prevent="handleArrowKey($event)"
1313
>
14-
<div ref="containerRef" :class="containerClass" role="grid" :style="{ height: `${containerHeight}px` }">
14+
<div
15+
ref="containerRef"
16+
:class="containerClass"
17+
role="grid"
18+
:style="{ '--dp-overlay-height': `${containerHeight}px` }"
19+
>
1520
<div class="dp__selection_grid_header"><slot name="header"></slot></div>
1621
<template v-if="$slots.overlay">
1722
<slot name="overlay" />

src/VueDatePicker/style/components/_SelectionOverlay.scss

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
.dp__overlay_container {
5151
flex-direction: column;
5252
overflow-y: auto;
53+
height: var(--dp-overlay-height)
5354
}
5455

5556
.dp__time_picker_overlay_container {

0 commit comments

Comments
 (0)