popmotion icon indicating copy to clipboard operation
popmotion copied to clipboard

Cannot select text in input field

Open alyrik opened this issue 11 years ago • 5 comments

This happens after some animations play. It is still possible to select input text via dblclick but it's impossible to do this by dragging a mouse pointer. Form is inside a tracked and animated element. Is there a way to remove popmotion instance from a connected element?

CodePen demo: http://codepen.io/anon/pen/OygYgB

alyrik avatar Oct 10 '15 12:10 alyrik

Hey man

The problem here is probably preventDefault - the default being the input gains focus. You can probably comment both these things out and it'll work properly:

    $body.on('mousedown touchstart', ballActor.element, function (event) {
        //event.stopPropagation();
        //event.preventDefault();

        ballActor.start(trackBall, event);

        $body.on('mouseup touchend', function () {
            ballActor.stop();
        });
    });

mattgperry avatar Oct 10 '15 12:10 mattgperry

It doesn't help. Even if I remove this handler after mouseup:

$body.on('mouseup touchend', function () {
    $body.off('mousedown touchstart mouseup touchend');
    ballActor.stop();
});

The question is how to completely deactivate popmotion attached to a specific element?

alyrik avatar Oct 10 '15 12:10 alyrik

I see what you mean now, I'll look into this further. I have an idea what's causing this.

mattgperry avatar Oct 10 '15 12:10 mattgperry

@alyrik Hey dude I've just pushed a fix with 3.3.2, could you let me know if it works for you? Thanks

mattgperry avatar Oct 10 '15 13:10 mattgperry

Yeah, it works here - CodePen example. Thank you! Great!

Though it doesn't work in my project but it may be my fault. Trying to overcome.

alyrik avatar Oct 10 '15 13:10 alyrik