Comments (4)
@stardust66 thanks for your superb explanations !
Okay I will set touch-action="none" to the LongPress wrapped html element if I encounter problems with Safari < 13
from react-longpressable.
Unfortunately, Safari doesn't support Pointer Events yet. React v16.4.0 release notes say this:
Please note that these events will only work in browsers that support the Pointer Events specification. (At the time of this writing, this includes the latest versions of Chrome, Firefox, Edge, and Internet Explorer.) If your application depends on pointer events, we recommend using a third-party pointer events polyfill. We have opted not to include such a polyfill in React DOM, to avoid an increase in bundle size.
So, you need a polyfill. I believe this is the best one: https://github.com/jquery/PEP.
from react-longpressable.
what would be the propery way to add this polyfill ?
I'm not sure to understand the touch-action attribute
from react-longpressable.
You'd add it by including the polyfill script tag in your document. As of now, Safari (even iOS Safari) does support Pointer Events so I can't really test the polyfill anywhere. As far as I know, touch-action
is meant to be a CSS property in the specs, but the polyfill uses it as an attribute instead. The polyfill README says that you should set the touch-action
attribute on elements before they can generate touch events. The easiest is to probably do touch-action="none"
.
Here is a demo I found explaining what touch-action
does. You can see how it works by running the site on a touch device: https://www.chenhuijing.com/touch-action/
Here is an explanation from the polyfill: https://github.com/jquery/PEP#touch-action
Here is its documentation of the CSS property in the specs: https://www.w3.org/TR/pointerevents/#the-touch-action-css-property
Let me know what problems you are running into.
from react-longpressable.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-longpressable.