react-forcefield
v1.0.6
Published
Prevent unintentional interactions until click or touch
Downloads
56
Maintainers
Readme
react-forcefield
Prevent unintentional interactions(scroll, zoom, etc) until click or touch.
Documentation
Demo & Examples
Live demo: react-forcefield.coston.io
To build the examples locally, run:
npm install
npm start
Then open localhost:8080
in a browser.
Installation
The easiest way to use react-forcefield is to install it from npm and include it in your own React build process (using Browserify, Webpack, etc).
You can also use the standalone build by including dist/react-forcefield.js
in your page. If you use this, make sure you have already included React, and it is available as a global variable.
npm install react-forcefield --save
Usage
To use, import Forcefield from 'react-forcefield
, wrap some code in the <Forcefield>
component, and voilà!
import React from 'react'
import Forcefield from 'react-forcefield'
const Example = () => (
<Forcefield>
<iframe
src="https://basic-map.coston.io"
style={{ border: '1px #eee solid' }}
height="800px"
width="100%"
/>
</Forcefield>
)
Contributing
Please help make this component better. All issues and/or pull requests are very welcome.
License
MIT License