SAP Spartacus B2B

Implementationassociated with the enter key event:

<cx-table
        *ngIf="data.values? .length > 0; else emptyList"
        [structure] ="structure"
        [data] ="data.values"
        [i18nRoot] ="domainType"
        [currentItem] ="{ property: key, value: currentKey$ | async }"
        (launch) ="launchItem($event)"
        [cxFocus] ="{ trap: 'both' }"
      >
      </cx-table>
Copy the code

Call stack: Observe how the handleEnter function in lock-focus.directive.ts is called by Angular Core:

The event passed to the Focus Directive: KeyboardEvent

  • Code to Enter.
  • currentTarget: cx-table.vertical
  • eventPhase: 3
  • key: Enter
  • keyCode: 13

Type: keydown

More of Jerry’s original articles can be found in “Wang Zixi” :