mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
chore: fix eslint in blocksuite (#9232)
This commit is contained in:
@@ -45,17 +45,17 @@ export class MenuInput extends MenuFocusable {
|
||||
}
|
||||
`;
|
||||
|
||||
private onCompositionEnd = () => {
|
||||
private readonly onCompositionEnd = () => {
|
||||
this.data.onChange?.(this.inputRef.value);
|
||||
};
|
||||
|
||||
private onInput = (e: InputEvent) => {
|
||||
private readonly onInput = (e: InputEvent) => {
|
||||
e.stopPropagation();
|
||||
if (e.isComposing) return;
|
||||
this.data.onChange?.(this.inputRef.value);
|
||||
};
|
||||
|
||||
private onKeydown = (e: KeyboardEvent) => {
|
||||
private readonly onKeydown = (e: KeyboardEvent) => {
|
||||
e.stopPropagation();
|
||||
if (e.isComposing) return;
|
||||
if (e.key === 'Escape') {
|
||||
@@ -71,7 +71,7 @@ export class MenuInput extends MenuFocusable {
|
||||
}
|
||||
};
|
||||
|
||||
private stopPropagation = (e: Event) => {
|
||||
private readonly stopPropagation = (e: Event) => {
|
||||
e.stopPropagation();
|
||||
};
|
||||
|
||||
@@ -140,17 +140,17 @@ export class MobileMenuInput extends MenuFocusable {
|
||||
}
|
||||
`;
|
||||
|
||||
private onCompositionEnd = () => {
|
||||
private readonly onCompositionEnd = () => {
|
||||
this.data.onChange?.(this.inputRef.value);
|
||||
};
|
||||
|
||||
private onInput = (e: InputEvent) => {
|
||||
private readonly onInput = (e: InputEvent) => {
|
||||
e.stopPropagation();
|
||||
if (e.isComposing) return;
|
||||
this.data.onChange?.(this.inputRef.value);
|
||||
};
|
||||
|
||||
private stopPropagation = (e: Event) => {
|
||||
private readonly stopPropagation = (e: Event) => {
|
||||
e.stopPropagation();
|
||||
};
|
||||
|
||||
|
||||
@@ -83,13 +83,13 @@ export class MenuComponent
|
||||
}
|
||||
`;
|
||||
|
||||
private _clickContainer = (e: MouseEvent) => {
|
||||
private readonly _clickContainer = (e: MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
this.focusInput();
|
||||
this.menu.closeSubMenu();
|
||||
};
|
||||
|
||||
private searchRef = createRef<HTMLInputElement>();
|
||||
private readonly searchRef = createRef<HTMLInputElement>();
|
||||
|
||||
override firstUpdated() {
|
||||
const input = this.searchRef.value;
|
||||
|
||||
@@ -57,9 +57,9 @@ export function onMenuOpen(listener: MenuOpenListener) {
|
||||
export class Menu {
|
||||
private _cleanupFns: Array<() => void> = [];
|
||||
|
||||
private _currentFocused$ = signal<MenuFocusable>();
|
||||
private readonly _currentFocused$ = signal<MenuFocusable>();
|
||||
|
||||
private _subMenu$ = signal<Menu>();
|
||||
private readonly _subMenu$ = signal<Menu>();
|
||||
|
||||
closed = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user