Use nextTick() instead of random timeout

This commit is contained in:
Johannes Zellner
2025-06-25 15:47:08 +02:00
parent dc7b425dc5
commit c779701d26
+3 -7
View File
@@ -5,7 +5,7 @@ const i18n = useI18n();
const t = i18n.t;
import moment from 'moment';
import { ref, computed, useTemplateRef, onMounted, inject, watch } from 'vue';
import { ref, computed, useTemplateRef, onMounted, inject, watch, nextTick } from 'vue';
import { TextInput, Spinner, InputDialog, SingleSelect } from 'pankow';
import AppsModel from '../models/AppsModel.js';
import AppstoreModel from '../models/AppstoreModel.js';
@@ -161,12 +161,8 @@ onMounted(async () => {
});
}
} else {
setTimeout(() => {
try {
searchInput.value.$el.focus();
// eslint-disable-next-line no-unused-vars
} catch(e) {;}
}, 100);
await nextTick();
if (searchInput.value) searchInput.value.$el.focus();
}
});