Merge branch 'Radius/fix-automatically-selecting-estmk' into 'master'
fixed the automatic selection in the autocomplete See merge request fronk/thetool!2077
This commit is contained in:
@@ -9,6 +9,7 @@ const RadiusUsers = {
|
||||
<tt-smart-autocomplete
|
||||
v-model="billAddrDisplay"
|
||||
:wide="true"
|
||||
:initial-mode="searchMode"
|
||||
placeholder="Kunde suchen"
|
||||
@select="onAddrSelect"
|
||||
@enter="loadRadiusUsers"
|
||||
|
||||
@@ -21,6 +21,10 @@ const TtSmartAutocomplete = {
|
||||
apiEndpoint: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
initialMode: {
|
||||
type: String,
|
||||
default: 'autocomplete'
|
||||
}
|
||||
},
|
||||
emits: ['update:modelValue', 'select', 'change', 'enter', 'mode-change'],
|
||||
@@ -32,7 +36,7 @@ const TtSmartAutocomplete = {
|
||||
const items = ref({});
|
||||
const highlighted = ref(-1);
|
||||
const busy = ref(false);
|
||||
const mode = ref('autocomplete');
|
||||
const mode = ref(props.initialMode || 'autocomplete');
|
||||
const logoDropdownOpen = ref(false);
|
||||
const hasMoreResults = ref(false);
|
||||
const mainInput = ref(null);
|
||||
@@ -60,6 +64,12 @@ const TtSmartAutocomplete = {
|
||||
}
|
||||
});
|
||||
|
||||
watch(() => props.initialMode, (val) => {
|
||||
if (val && val !== mode.value) {
|
||||
mode.value = val;
|
||||
}
|
||||
});
|
||||
|
||||
const debounce = (fn, ms) => {
|
||||
let timeout;
|
||||
return (...args) => {
|
||||
|
||||
Reference in New Issue
Block a user