<commit_before>/**
 * @module
 * @prototype {Function} __wheelHandler
 */

import { SmoothScrollbar } from '../smooth_scrollbar';
import { getDelta, pickInRange } from '../utils/index';

export { SmoothScrollbar };

// is standard `wheel` event supported check
const WHEEL_EVENT = 'onwheel' in window ? 'wheel' : 'mousewheel';

/**
 * @method
 * @internal
 * Wheel event handler builder
 *
 * @param {Object} option
 *
 * @return {Function}: event handler
 */
let __wheelHandler = function() {
    const { container } = this.targets;

    this.__addEvent(container, WHEEL_EVENT, (evt) => {
        if (this.__ignoreEvent(evt, true)) return;

        const { offset, limit, options } = this;
        const delta = getDelta(evt);

        if (options.continuousScrolling) {
            let destX = pickInRange(delta.x + offset.x, 0, limit.x);
            let destY = pickInRange(delta.y + offset.y, 0, limit.y);

            if (Math.abs(destX - offset.x) < 1 && Math.abs(destY - offset.y) < 1) {
                return this.__updateThrottle();
            }
        }

        evt.preventDefault();
        evt.stopPropagation();

        this.__addMovement(delta.x, delta.y);
    });
};

Object.defineProperty(SmoothScrollbar.prototype, '__wheelHandler', {
    value: __wheelHandler,
    writable: true,
    configurable: true
});<commit_msg>remove(wheel): remove `evt.stopPropagation()`<commit_after>/**
 * @module
 * @prototype {Function} __wheelHandler
 */

import { SmoothScrollbar } from '../smooth_scrollbar';
import { getDelta, pickInRange } from '../utils/index';

export { SmoothScrollbar };

// is standard `wheel` event supported check
const WHEEL_EVENT = 'onwheel' in window ? 'wheel' : 'mousewheel';

/**
 * @method
 * @internal
 * Wheel event handler builder
 *
 * @param {Object} option
 *
 * @return {Function}: event handler
 */
let __wheelHandler = function() {
    const { container } = this.targets;

    this.__addEvent(container, WHEEL_EVENT, (evt) => {
        if (this.__ignoreEvent(evt, true)) return;

        const { offset, limit, options } = this;
        const delta = getDelta(evt);

        if (options.continuousScrolling) {
            let destX = pickInRange(delta.x + offset.x, 0, limit.x);
            let destY = pickInRange(delta.y + offset.y, 0, limit.y);

            if (Math.abs(destX - offset.x) < 1 && Math.abs(destY - offset.y) < 1) {
                return this.__updateThrottle();
            }
        }

        evt.preventDefault();
        // evt.stopPropagation();

        this.__addMovement(delta.x, delta.y);
    });
};

Object.defineProperty(SmoothScrollbar.prototype, '__wheelHandler', {
    value: __wheelHandler,
    writable: true,
    configurable: true
});
{'fraction_non_alphanumeric': 0.14196395733725634, 'fraction_numerical': 0.002942258183155572, 'mean_word_length': 2.7621023513139695, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7178774', 'n_tokens_mistral': 850, 'n_tokens_neox': 834, 'n_words': 198}