private bubbleEvent()

in src/focus.service.ts [545:571]


  private bubbleEvent(
    ev: ArcEvent,
    incoming: boolean,
    source: HTMLElement | null = this.selected,
  ): ArcEvent {
    for (let el = source; !ev.propagationStopped && el !== this.root && el; el = el.parentElement) {
      if (el === undefined) {
        console.warn(
          `arcade-machine focusable element was moved outside of` +
            'the focus root. We may not be able to handle focus correctly.',
          el,
        );
        break;
      }

      const directive = this.registry.find(el);
      if (directive) {
        if (incoming && directive.onIncoming) {
          directive.onIncoming(ev);
        } else if (!incoming && directive.onOutgoing) {
          directive.onOutgoing(ev);
        }
      }
    }

    return ev;
  }