title: In cypress how do you simulate pressing spacebar for keyboard navigation to open a select?
body: <p>How do you simulate the press of spacebar during keyboard navigation when using <a href="https://docs.cypress.io/api/commands/trigger.htm" rel="nofollow noreferrer">cypress</a> ?</p>
  <p>I have tried below and it doesn't work.</p>
  <pre><code>cy.get('#a-select')
    .trigger('keydown', {
      eventConstructor: 'KeyboardEvent',
      keyCode: 32,
      which: 32,
      shiftKey: false,
      ctrlKey: false,
    })
    .type('{downarrow}');
  </code></pre>
  <p>I also tried a variation of this on an input with keyCode 65 in an input and this doesn't work either.</p>
  <pre><code>    cy.get('#search').trigger('keydown', {
        eventConstructor: 'KeyboardEvent',
        keyCode: 65,
        which: 65,
        shiftKey: false,
        ctrlKey: false,
      });
      cy.get('#search').should('have.value', 'a');
  </code></pre>