Solución completa: corregir reset con la X, añadir limpieza de búsqueda y asegurar sincronización de paradas
This commit is contained in:
@ -74,7 +74,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import { ref, computed, watch } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const props = defineProps<{
|
||||
@ -91,6 +91,13 @@ defineEmits(['open', 'close', 'select-route'])
|
||||
const { t } = useI18n()
|
||||
const searchQuery = ref('')
|
||||
|
||||
// Reset search on panel close or selection clear
|
||||
watch([() => props.showPanel, () => props.selectedRouteId], ([show, routeId]) => {
|
||||
if (!show || !routeId) {
|
||||
searchQuery.value = ''
|
||||
}
|
||||
})
|
||||
|
||||
const filteredRoutes = computed(() => {
|
||||
if (!searchQuery.value.trim()) return props.allRoutes
|
||||
const query = searchQuery.value.toLowerCase().trim()
|
||||
|
||||
Reference in New Issue
Block a user