kbTrigger method

  1. @HostListener('keypress')
void kbTrigger(
  1. KeyboardEvent event
)

Implementation

@HostListener('keypress')
void kbTrigger(KeyboardEvent event) {
  if (event.keyCode == KeyCode.ENTER || isSpaceKey(event)) {
    _toggleVisibility();
    // Required to prevent window from scrolling.
    event.preventDefault();
  }
}