Commit 284855c1 authored by Дмитрий Малюгин's avatar Дмитрий Малюгин 🕓
Browse files

fix: 'Select'

parent 67ccc01f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ const meta: Meta = {
    filtered: { control: 'boolean' },
    disabled: { control: 'boolean' },
    noHighlight: { control: 'boolean' },
    selected: { control: 'text' },
    fontSize: { control: 'text' },
    placeholder: { control: 'text' },
    name: { control: 'text' },
+6 −1
Original line number Diff line number Diff line
<script setup lang="ts">
import type { ISelectProps } from '@interfaces/componentsProps';
import { computed, ref } from 'vue';
import { computed, ref, watch } from 'vue';
import { convertThemeToColor, convertThemeToTextColor } from '@helpers/common';
import { iconsSet } from '@/common/constants/icons';
import type { TThemeColor } from '@interfaces/common';
@@ -55,6 +55,11 @@ const calcOptionColor = (color: TThemeColor | undefined, darknessColor: string |
document.querySelector('body')!.addEventListener('pointerup', (e: MouseEvent) => {
  if (isOpen.value && e.button === 0) isOpen.value = false;
});

const selectedProp = computed(() => props.selected);
watch(selectedProp, () => (selected.value = selectedProp.value), {
  immediate: true,
});
</script>

<template>