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:
Luca Haid
2026-02-02 13:11:08 +00:00
2 changed files with 12 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ const RadiusUsers = {
<tt-smart-autocomplete
v-model="billAddrDisplay"
:wide="true"
:initial-mode="searchMode"
placeholder="Kunde suchen"
@select="onAddrSelect"
@enter="loadRadiusUsers"

View File

@@ -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) => {