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

When click the input box on your mobile browser, click and touchend event occur concurrently #26

Closed
jung-han opened this issue Mar 12, 2019 · 0 comments

Comments

@jung-han
Copy link
Member

jung-han commented Mar 12, 2019

Version

Development Environment

Current Behavior

// setTouchClickEvent.js
module.exports = function(target, handler, option) {
    var $target = $(target);
    var eventList = ['mouseup', 'touchend'];
    var selector, namespace, events;
    option = option || {};
    selector = option.selector || null;
    namespace = option.namespace || '';

    if (namespace) {
        eventList = snippet.map(eventList, function(eventName) {
            return eventName + '.' + namespace;
        });
    }

    events = eventList.join(' ');

    $target.on(events, selector, function onceHandler(ev) {
        var newEventName = ev.type + '.' + namespace;

        handler(ev);
        $target.off(events, selector, onceHandler)
            .on(newEventName, selector, handler);
    });
};

When click the input box on your mobile browser, click and touchend event occur concurrently

Expected Behavior

jung-han pushed a commit that referenced this issue Mar 26, 2019
* fix: Select events by using mobile

* chore: add comment to private method

* chore: apply review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant