GithubHelp home page GithubHelp logo

sessa / dyna-ui-fast-click Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aneldev/dyna-ui-fast-click

0.0 2.0 0.0 1.21 MB

Wrapper to get the click faster on mobile devices

License: MIT License

CSS 5.18% TypeScript 40.94% HTML 1.87% JavaScript 52.01%

dyna-ui-fast-click's Introduction

About

Wrapper to get faster the click on mobiles and tablets.

Global utils like fastclick are not working always and is not the cleanest solution.

Some controls need the pure events, global solutions produce problems is some cases.

So, the DynaFastClick applies the fast click solution only for what is wrapped.

Wrap it, listen the onClick event of the DynaFastClick and not of the content.

On desktop nothing is changing, the click event is the same one.

Written in TS runs everywhere.

Under the hood

The magic recipe

On mobiles, the onClick is called on touchendswallowing the click event.

Usage

    <DynaFastClick onClick={()=>console.log('clicked')}>
        <button>Post it</button>
    </DynaFastClick>

Demo

npm start

Props

All props are optional except the children.

IDynaFastClickProps = {
	className?: string;     // class name in order to style it
	nodeType?: string;      // default is "span" and creates <span/>, set to "div" to get <div/>
	children: any;          // the content
	onClick?: () => void;   // the click event, triggered as fast as possible
}

dyna-ui-fast-click's People

Watchers

 avatar  avatar

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.