Reset address when field is empty
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
57b1e53420
commit
6eb42660d5
@ -22,7 +22,7 @@
|
|||||||
expanded
|
expanded
|
||||||
@select="updateSelected"
|
@select="updateSelected"
|
||||||
>
|
>
|
||||||
<template slot-scope="{ option }">
|
<template #default="{ option }">
|
||||||
<b-icon :icon="option.poiInfos.poiIcon.icon" />
|
<b-icon :icon="option.poiInfos.poiIcon.icon" />
|
||||||
<b>{{ option.poiInfos.name }}</b
|
<b>{{ option.poiInfos.name }}</b
|
||||||
><br />
|
><br />
|
||||||
@ -31,7 +31,7 @@
|
|||||||
<template slot="empty">
|
<template slot="empty">
|
||||||
<span v-if="isFetching">{{ $t("Searching…") }}</span>
|
<span v-if="isFetching">{{ $t("Searching…") }}</span>
|
||||||
<div v-else-if="queryText.length >= 3" class="is-enabled">
|
<div v-else-if="queryText.length >= 3" class="is-enabled">
|
||||||
<span>{{ $t('No results for "{queryText}"') }}</span>
|
<span>{{ $t('No results for "{queryText}"', { queryText }) }}</span>
|
||||||
<span>{{
|
<span>{{
|
||||||
$t(
|
$t(
|
||||||
"You can try another search term or drag and drop the marker on the map",
|
"You can try another search term or drag and drop the marker on the map",
|
||||||
@ -302,6 +302,14 @@ export default class FullAddressAutoComplete extends Vue {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Watch("queryText")
|
||||||
|
resetAddressOnEmptyField(queryText: string): void {
|
||||||
|
if (queryText === "" && this.selected?.id) {
|
||||||
|
console.log("doing reset");
|
||||||
|
this.resetAddress();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
resetAddress(): void {
|
resetAddress(): void {
|
||||||
this.$emit("input", null);
|
this.$emit("input", null);
|
||||||
this.queryText = "";
|
this.queryText = "";
|
||||||
|
Loading…
Reference in New Issue
Block a user