Code Monkey home page Code Monkey logo

simulant's Introduction

simulant's People

Contributors

henrikjoreteg avatar levithomason avatar rich-harris avatar traviskaufman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simulant's Issues

How does simulant differ from using other synthetic DOM event libraries?

There are couple of alternatives for this library https://github.com/bitovi/syn and http://postdocs.stanford.edu/Templates/yui-3.5.0/docs/event/simulate.html.

I've been using Syn earlier and now I'm looking for replacement, since in previous projects we had to patch it heavily. Specially handling change event for select was hard for it :)

YUI might be good choice since it has been around forever, but I would prefer smaller lib, which concentrates only to handle event simulation. Do you have any comments how simulant compare to YUI?

pageX and pageY on mousemove

Is it possible to set pageX and pageY on the mousemove event? Something like this would be nice:

simulant.fire(document, 'mousemove', {
      pageX: 0,
      pageY: 0
})

but on the event handler all I get is {"isTrusted":false} no matter what I put in the options.

Error when call beforeUnload event

It has this error when I try to call `beforeUnloadEvent'

TypeError: 'undefined' is not an object (evaluating 'maps__initialisersByGroup[group][1]')

`simulant.fire` return enhancement

Currently simulant.fire doesn't return anything. Would be awesome if it returned the event object, either the passed in one, or the created one.

simulant.js.map does not exist

The current distribution build of simulant specifies simulant.js.map as the source mapping URL (

//# sourceMappingURL=simulant.js.map
), but simulant.js.map does not seem to exist. Perhaps a build issue?

(As an aside, I find it amusing that the source map URL happens to be defined on line 404 =)

Override target

Can the target property of the event be overridden? This could be useful for instance when firing a change event on an input[type=file] element to allow setting the e.target.files property?

Example: http://stackoverflow.com/a/25098258.

Fire keyup enter event?

Does anyone know how to fire a keyup enter event?

I have tried the following:

simulant.fire(target, 'keyup', { keyCode: 13, which:13 });

But it does not seem to work.

does not work in npm

Doesn't seem to support npm or node/browserify.. why is it even published on npm?

pointerdown, pointerup events support

Hi!

When I tried to make a trigger for the tap event (for Ractive on-tap with ractive-events-tap plugin):

$.fn.r_trigger = (event_name, opt)->
    el = @[0]
    return if !el
    switch event_name
        when 'tap'
            if win.navigator.pointerEnabled
                simulant.fire(el, 'pointerdown', opt)
                simulant.fire(el, 'pointerup', opt)
            else if win.navigator.msPointerEnabled
                simulant.fire(el, 'MSPointerDown', opt)
                simulant.fire(el, 'MSPointerUp', opt)
            else
                simulant.fire(el, 'mousedown', opt)
                simulant.fire(el, 'click', opt)
        else
            simulant.fire(el, event_name, opt)
    @

I encountered a problem that Simulant fails to fire some events in the legacy mode.
So I had to add 4 events pointerdown pointerup MSPointerDown MSPointerUp to the the eventTypesByGroup.Event

I'm not sure if it is the best way to resolve the problem, so I didn't do a pull request.

Thanks for the lib!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.