Use nextTick() instead of random timeout
This commit is contained in:
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user