Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to preventDefault inside passive event listener invocation. #3143

Open
applibs opened this issue Nov 9, 2023 · 1 comment
Open

Unable to preventDefault inside passive event listener invocation. #3143

applibs opened this issue Nov 9, 2023 · 1 comment

Comments

@applibs
Copy link

applibs commented Nov 9, 2023

Anybody has same problem?

Unable to preventDefault inside passive event listener invocation.

Snímek obrazovky 2023-11-09 164039

@applibs
Copy link
Author

applibs commented Nov 9, 2023

This is my fix:

Chosen.prototype.search_results_mousewheel = function (evt) {
            var delta;
            if (evt.originalEvent) {
                delta = evt.originalEvent.deltaY || -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
            }
            if (delta != null) {
                if (evt.cancelable) {
                    evt.preventDefault();
                }
                //evt.preventDefault();
                if (evt.type === 'DOMMouseScroll') {
                    delta = delta * 40;
                }
                return this.search_results.scrollTop(delta + this.search_results.scrollTop());
            }
        };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant