fix(fe): broken select box menu after SSR reload

This commit is contained in:
Kristaps Fabians Geikins
2023-11-01 15:50:55 +02:00
parent ad26a5b486
commit f3d6484d97
2 changed files with 6 additions and 1 deletions
@@ -70,6 +70,7 @@
<XMarkIcon class="w-3 h-3" />
</button>
<Transition
v-if="isMounted"
leave-active-class="transition ease-in duration-100"
leave-from-class="opacity-100"
leave-to-class="opacity-0"
@@ -208,7 +209,7 @@ import { RuleExpression, useField } from 'vee-validate'
import { nanoid } from 'nanoid'
import CommonLoadingBar from '~~/src/components/common/loading/Bar.vue'
import { directive as vTippy } from 'vue-tippy'
import { useElementBounding } from '@vueuse/core'
import { useElementBounding, useMounted } from '@vueuse/core'
type ButtonStyle = 'base' | 'simple' | 'tinted'
type ValueType = SingleItem | SingleItem[] | undefined
@@ -396,6 +397,8 @@ const { value, errorMessage: error } = useField<ValueType>(props.name, props.rul
initialValue: props.modelValue as ValueType
})
const isMounted = useMounted()
const searchInput = ref(null as Nullable<HTMLInputElement>)
const listboxButton = ref(null as Nullable<{ el: Nullable<HTMLButtonElement> }>)
const searchValue = ref('')
@@ -0,0 +1,2 @@
export const isSSR =
typeof window !== 'undefined' && typeof window.document !== 'undefined'