提交 77e08258 编写于 作者: X xjh22222228

fix: input autofocus

上级 e97c9be2
......@@ -21,11 +21,15 @@ export class SearchEngineComponent implements OnInit {
ngOnInit(): void {
}
ngAfterViewInit() {
inputFocus() {
const inputEl = document.getElementById('search-engine-input')
if (inputEl) {
inputEl.focus()
}
}
ngAfterViewInit() {
this.inputFocus()
document.addEventListener('click', () => {
this.toggleEngine(null, false)
......@@ -44,6 +48,7 @@ export class SearchEngineComponent implements OnInit {
clickEngineItem(index) {
this.currentEngine = SEARCH_ENGINE_LIST[index]
this.toggleEngine()
this.inputFocus()
setDefaultSearchEngine(this.currentEngine)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册