fix(search-select) : affiche modelValue au mount en mode creatable
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled

En mode creatable, modelValue n'est pas dans options donc selectedOption est null.
Le onMounted ecrasait searchTerm a vide apres que le watch immediate l'avait initialise.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-05-11 16:52:28 +02:00
parent 48c5c5bb33
commit b67af56bd1

View File

@@ -388,7 +388,11 @@ const handleGlobalClick = (event) => {
onMounted(() => {
window.addEventListener('click', handleGlobalClick)
searchTerm.value = selectedOption.value ? resolveLabel(selectedOption.value) : ''
if (props.creatable) {
searchTerm.value = String(props.modelValue ?? '')
} else {
searchTerm.value = selectedOption.value ? resolveLabel(selectedOption.value) : ''
}
})
onBeforeUnmount(() => {