fixes bug in checkin rules editor where jquery select2 does not get removed correctly from DOM (#6206)

This commit is contained in:
rash
2026-05-26 19:33:31 +02:00
committed by GitHub
parent ed25a8b073
commit 94aec6f511

View File

@@ -100,14 +100,19 @@ watch(() => props.value, (newval, oldval) => {
} }
}) })
let rawSelectEl: HTMLSelectElement | null = null
onMounted(() => { onMounted(() => {
rawSelectEl = select.value
build() build()
}) })
onUnmounted(() => { onUnmounted(() => {
$(select.value) if (!rawSelectEl) return
$(rawSelectEl)
.off() .off()
.select2('destroy') .select2('destroy')
rawSelectEl = null
}) })
</script> </script>
<template lang="pug"> <template lang="pug">