import Ember from 'ember';

export default Ember.Component.extend({
  tagName: 'tr',
  attributeBindings: ['tabindex'],

  click () {
    this.sendAction('action', this.get('expenseId'));
  },

  keyDown (event) {
    if (event.which === 13) {
      this.sendAction('action', this.get('expenseId'));
    }
  }
});

@@ -293,16 +293,1160 @@
 eId'));%0A
+  backgroundLock () %7B%0A    const backgroundActiveEl = document.activeElement;%0A    const optionsMenu = document.getElementById(this.get('menuOptionID'));%0A    const focusableElements = optionsMenu.querySelectorAll('button:not(%5Bdisabled%5D)');%0A    const firstEl = focusableElements%5B0%5D;%0A    const lastEl = focusableElements%5BfocusableElements.length - 1%5D;%0A%0A    // Focus first element in menu%0A    optionsMenu.addEventListener('keydown', (event) =%3E %7B%0A      // If Esc pressed%0A      if (event.keyCode === 27) %7B%0A        event.stopPropagation();%0A        $('.activated').removeClass('activated');%0A        return backgroundActiveEl.focus();%0A      %7D%0A%0A      // Trap Tab key while menu open%0A      this.trapTabKey(event, firstEl, lastEl);%0A    %7D);%0A  %7D,%0A%0A  trapTabKey (event, ...params) %7B%0A    const %5B firstEl, lastEl %5D = params;%0A%0A    if (event.keyCode === 9) %7B%0A      if (event.shiftKey) %7B%0A        if (document.activeElement === firstEl) %7B%0A          event.preventDefault();%0A          return lastEl.focus();%0A        %7D%0A      %7D else %7B%0A        if (document.activeElement === lastEl) %7B%0A          event.preventDefault();%0A          return firstEl.focus();%0A        %7D%0A      %7D%0A
     %7D%0A  

Add trap tab key for table cell menu