Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

414 B
Raw Blame
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;
}