Comments (9)
Got it to work I replaced the following
$(document).on('touchmove', function (e) {
if (e.target.tagName == "CANVAS") {
e.preventDefault();
}
}
with
window.addEventListener('touchmove', function (e) {
if (e.target.tagName == "CANVAS") {
e.preventDefault();
}
}, { passive: false });
The passive false is imp.
Basically the call is
window.addEventListener('touchmove', func, { passive: false })
from body-scroll-lock.
Hi,
I faced the same issue for latest iOS. Even { passive: false }
for event listener doesn't seem to work to me. Is there another workaround?
from body-scroll-lock.
Hi
Please note the only way I was able to get this to work was to add the event listener on the window object
window.addEventListener
It does not work where I use the "document"
Kind Regards
Sandeep
from body-scroll-lock.
Thanks Sandeep! That may be the cause - will try it.
from body-scroll-lock.
so is this fixed for ios 11> ?
from body-scroll-lock.
It did for our project.
You can check the pages we are using this on
https://www.oka.com/cushion-arranger/
Kind Regards
Sandeep
from body-scroll-lock.
There is a way to use it without npm or yarn ? pure JS, no require ?
from body-scroll-lock.
Closing issue as it appears the latest ios > 11 fixed the issue.
from body-scroll-lock.
@inkquery not without some work on your end.
To do what you want, you first need to download npm/yarn =). But after that, just fork/clone the repo, then run yarn build
. Then grab the file with the compiled javascript code, make some mods to expose the logic globally....
As its open source, feel free to do above, as long as credit is provided where due =)
from body-scroll-lock.
Related Issues (20)
- Safari toolbars on iOS 15 show and hide when scrolling within a scrollable element HOT 6
- When enabled, scrolls to top of document in iOS Safari on Version: 4.0.0-beta.0 HOT 8
- Header Logo doesn't change to stacked version on Mobile
- Scroll bar width calculated incorrectly HOT 3
- Enabling and clearing body scroll don't work on iOS 15.1
- The scroll lock does not work if you swipe with two fingers at the same time
- Still able to scroll HOT 5
- Doesn't seem to lock HTML tag scrolling HOT 2
- iOS Devices: "restorePositionSetting" can run before "setPositionFixed"
- Inset of iOS devices is scrollable on modals HOT 1
- The content is twitching 15px from the right on MacOS Safari HOT 3
- Black bar at bottom when safari toolbar is hidden on iOS 15
- The package is not tree-shakeable due to side-effects
- Is this package dead/abandoned? HOT 17
- Define a custom base element (not body) HOT 1
- iOS 16 Safari has width/size issues with wide content HOT 2
- This fork from vercel seems to fix some issues HOT 1
- Add example using React hooks HOT 1
- On IOS disableBodyScroll() makes element.scrollIntoView() not working HOT 1
- ESM build broken, causes scroll-to-top on iOS HOT 3
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 body-scroll-lock.