Giter Site home page Giter Site logo

Comments (4)

mattbryson avatar mattbryson commented on June 10, 2024 1

from touchswipe-jquery-plugin.

YenHub avatar YenHub commented on June 10, 2024

I have found also that this leads to console errors as such:

[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/6662647093133312

Scrolling performance, using this plugin on desktop devices, is laggy and leaves the UI feeling at times unresponsive and glitchy as the scroll fights the wheel steps down the page.

Commenting out the following function improves scrolling performance and dramatically smooths out the scrolling:-

function wheel(event) {
    if (!initDone) {
        init();
    }
	// This is the problematic section of code
    // var target = event.target;
    // var overflowing = overflowingAncestor(target);
    // if (!overflowing || event.defaultPrevented || isNodeName(activeElement, "embed") || (isNodeName(target, "embed") && /\.pdf/i.test(target.src))) {
    //     return true;
    // }
    // var deltaX = event.wheelDeltaX || 0;
    // var deltaY = event.wheelDeltaY || 0;
    // if (!deltaX && !deltaY) {
    //     deltaY = event.wheelDelta || 0;
    // }
    // if (!options.touchpadSupport && isTouchpad(deltaY)) {
    //     return true;
    // }
    // if (Math.abs(deltaX) > 1.2) {
    //     deltaX *= options.stepSize / 120;
    // }
    // if (Math.abs(deltaY) > 1.2) {
    //     deltaY *= options.stepSize / 120;
    // }
    // scrollArray(overflowing, -deltaX, -deltaY);
    //event.preventDefault();
    }

I am unsure at this stage what effect this will have on mobile devices scrolling abilities.

I may opt to implement a device type test before allowing this particular section of code to run, therefore reclaiming scroll performance on Desktop whilst preserving functionality on touch devices.

from touchswipe-jquery-plugin.

rsmith4321 avatar rsmith4321 commented on June 10, 2024

I've noticed this is still an issue. Will this be fixed in a future version? Thanks!

from touchswipe-jquery-plugin.

holoduke avatar holoduke commented on June 10, 2024

Is this issue fixed?

from touchswipe-jquery-plugin.

Related Issues (20)

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.