mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
fix(core): input not automatically focused (#10050)
Fix issue [AF-2161](https://linear.app/affine-design/issue/AF-2161).
This commit is contained in:
@@ -7,7 +7,7 @@ import { SignalWatcher, WithDisposable } from '@blocksuite/affine/global/utils';
|
||||
import { SearchIcon } from '@blocksuite/icons/lit';
|
||||
import type { DocMeta } from '@blocksuite/store';
|
||||
import { css, html } from 'lit';
|
||||
import { property, state } from 'lit/decorators.js';
|
||||
import { property, query, state } from 'lit/decorators.js';
|
||||
|
||||
import type { DocSearchMenuConfig } from '../chat-config';
|
||||
import type { ChatChip } from '../chat-context';
|
||||
@@ -93,11 +93,20 @@ export class ChatPanelAddPopover extends SignalWatcher(
|
||||
@property({ attribute: false })
|
||||
accessor abortController!: AbortController;
|
||||
|
||||
@query('.search-input')
|
||||
accessor searchInput!: HTMLInputElement;
|
||||
|
||||
override connectedCallback() {
|
||||
super.connectedCallback();
|
||||
this._updateDocGroup();
|
||||
}
|
||||
|
||||
override firstUpdated() {
|
||||
requestAnimationFrame(() => {
|
||||
this.searchInput.focus();
|
||||
});
|
||||
}
|
||||
|
||||
override render() {
|
||||
const items = Array.isArray(this._docGroup.items)
|
||||
? this._docGroup.items
|
||||
|
||||
Reference in New Issue
Block a user