Coder Social home page Coder Social logo

Comments (4)

lawitschka avatar lawitschka commented on August 11, 2024

Yes, works with Ember 2.x and actions

from ember-cli-fastclick.

cbetta avatar cbetta commented on August 11, 2024

Ok, still seems slow to me somehow. Any idea how I can confirm if it's working for me correctly?

from ember-cli-fastclick.

lawitschka avatar lawitschka commented on August 11, 2024

I just tried it out in the lib's dummy app by adding a button which triggers a route action.

index.hbs

<button type="button" name="button" {{action 'logClick'}}>
  Click me!
</button>

index.js

import Ember from 'ember';

export default Ember.Route.extend({
  actions: {
    logClick() {
      window.console.log('Clicked');
    }
  }
});

Opening the app in Chrome, browsing through the sources, you will find the FastClick library in localhost:4200/assets/bower_components/fastclick/lib/fastclick.js. The method where the magic happens is onTouchEnd(). I just placed a breakpoint in line 606, in the following if block:

// localhost:4200/assets/bower_components/fastclick/lib/fastclick.js
if (!this.needsClick(targetElement)) {
  event.preventDefault();
  this.sendClick(targetElement, event);
}

When activating Emulate touch screen in the Developer Tools, execution stops at the breakpoint. When it is disabled, it does not stop, thus the click event is handled by the browser and not FastClick.

That is the way you can confirm, that it is working. At least, that is, what I just found out. Looked into how to confirm it is working for the first time. Before I luckily could always feel the difference.

from ember-cli-fastclick.

cbetta avatar cbetta commented on August 11, 2024

Awesome, tnx!

from ember-cli-fastclick.

Related Issues (9)

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.