diff --git a/ui/src/tempVars/components/TemplatePreviewList.tsx b/ui/src/tempVars/components/TemplatePreviewList.tsx index 1ecf8670af..90c8b752cc 100644 --- a/ui/src/tempVars/components/TemplatePreviewList.tsx +++ b/ui/src/tempVars/components/TemplatePreviewList.tsx @@ -8,7 +8,7 @@ import {TEMPLATE_PREVIEW_LIST_DIMENSIONS as DIMENSIONS} from 'src/tempVars/const import {TemplateValue} from 'src/types' -const {RESULTS_TO_DISPLAY, LI_HEIGHT, LI_MARGIN_BOTTOM} = DIMENSIONS +const {RESULTS_TO_DISPLAY, LI_HEIGHT, LI_MARGIN_BOTTOM, OFFSET} = DIMENSIONS interface Props { items: TemplateValue[] @@ -21,11 +21,12 @@ class TemplatePreviewList extends PureComponent { const {items, onUpdateDefaultTemplateValue} = this.props return ( -
- +
+ {items.map(item => ( { const {items} = this.props const count = Math.min(items.length, RESULTS_TO_DISPLAY) - return count * (LI_HEIGHT + LI_MARGIN_BOTTOM) + return count * (LI_HEIGHT + LI_MARGIN_BOTTOM) - OFFSET } } diff --git a/ui/src/tempVars/constants/index.ts b/ui/src/tempVars/constants/index.ts index 7143d84bc5..a1e4658eeb 100644 --- a/ui/src/tempVars/constants/index.ts +++ b/ui/src/tempVars/constants/index.ts @@ -191,7 +191,8 @@ interface PreviewListDimensions { export const TEMPLATE_PREVIEW_LIST_DIMENSIONS: Readonly< PreviewListDimensions > = { - RESULTS_TO_DISPLAY: 10, + RESULTS_TO_DISPLAY: 9, LI_HEIGHT: 28, LI_MARGIN_BOTTOM: 2, + OFFSET: 14, }