index.js
function _onKeyDown(e) {
  var keyCode = e.keyCode;

  if (keyCode === 13 || keyCode === 32) {
    this.keyDownFlag = true; // if host element does not naturally trigger a click event on spacebar, we can force one to trigger here.
    // careful! if host already triggers click events naturally, we end up with a "double-click".

    if (keyCode === 32 && this.options.simulateSpacebarClick === true) {
      this.hostEl.click();
    }
  }
}
function _onKeyDown(e) {
  var keyCode = e.keyCode;

  if (keyCode === 13 || keyCode === 32) {
    this.keyDownFlag = true; // if host element does not naturally trigger a click event on spacebar, we can force one to trigger here.
    // careful! if host already triggers click events naturally, we end up with a "double-click".

    if (keyCode === 32 && this.options.simulateSpacebarClick === true) {
      this.hostEl.click();
    }
  }
}
function _onKeyDown ( e ) { var keyCode = e . keyCode ; if ( keyCode === 13 || keyCode === 32 ) { this . keyDownFlag = true ; // if host element does not naturally trigger a click event on spacebar, we can force one to trigger here. // careful! if host already triggers click events naturally, we end up with a "double-click". if ( keyCode === 32 && this . options . simulateSpacebarClick === true ) { this . hostEl . click ( ) ; } } }
when options.expandOnClick is true, we set a flag if spacebar or enter are pressed the idea being that this flag is set BEFORE the click event
when options . expandOnClick is true we set a flag if spacebar or enter are pressed the idea being that this flag is set BEFORE the click event