correction about issue #1556 : Fix location on homepage and location clearing
This commit is contained in:
@@ -374,7 +374,7 @@ const asyncData = async (query: string): Promise<void> => {
|
||||
};
|
||||
|
||||
const selectedAddressText = computed(() => {
|
||||
if (!selected) return undefined;
|
||||
if (!selected || !selected.id) return undefined;
|
||||
return addressFullName(selected);
|
||||
});
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
:default-text="locationDefaultText"
|
||||
labelClass="sr-only"
|
||||
:placeholder="t('e.g. Nantes, Berlin, Cork, …')"
|
||||
v-on:update:modelValue="modelValueUpdate"
|
||||
/>
|
||||
<o-button native-type="submit" icon-left="magnify">
|
||||
<template v-if="search">{{ t("Go!") }}</template>
|
||||
@@ -95,6 +96,10 @@ const search = computed({
|
||||
},
|
||||
});
|
||||
|
||||
const modelValueUpdate = (newlocation: IAddress | null) => {
|
||||
emit("update:location", newlocation);
|
||||
};
|
||||
|
||||
const submit = () => {
|
||||
emit("submit");
|
||||
const { lat, lon } = addressToLocation(location.value);
|
||||
|
||||
Reference in New Issue
Block a user