Skip to content

Feature Request: keyup event simulator #6

@jfgomez86

Description

@jfgomez86

I just noticed you simulate a 'keypress' event, which doesn't actually mean a 'keyup' event will be triggered when running the fireunit.key helper.
It would be nice if you could add a 'keyup' event helper.
I'm no javascript ninja, but this worked for me:

  // Extend fireunit to make it simulate a keyUp event
  fireunit.keyup = function ( node ){
    node = this.id( node );

    var doc = node.ownerDocument, event = doc.createEvent("KeyEvents");
    event.initKeyEvent("keyup", true, true, doc.defaultView, false, false, false,
    false, false, false);
    return node.dispatchEvent( event );
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions