mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-24 22:09:08 +08:00
chore: merge blocksuite source code (#9213)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { computed } from '@preact/signals-core';
|
||||
|
||||
import { MenuItem } from './item.js';
|
||||
|
||||
export abstract class MenuFocusable extends MenuItem {
|
||||
isFocused$ = computed(() => this.menu.currentFocused$.value === this);
|
||||
|
||||
override connectedCallback() {
|
||||
super.connectedCallback();
|
||||
this.dataset.focusable = 'true';
|
||||
}
|
||||
|
||||
override focus() {
|
||||
this.menu.focusTo(this);
|
||||
}
|
||||
|
||||
abstract onPressEnter(): void;
|
||||
}
|
||||
Reference in New Issue
Block a user