dyna-ui-fast-click
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

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
}

Readme

Keywords

none

Package Sidebar

Install

npm i dyna-ui-fast-click

Weekly Downloads

1

Version

1.0.6

License

MIT

Unpacked Size

39 kB

Total Files

34

Last publish

Collaborators

  • dennisat