Question

I'm running into some trouble with the Enyo "ondragfinish" event. The code below is intended to send the message "quux" to the web console after the image is dragged and released, but most of the time this does not happen until I click somewhere away from the image or start to drag the image again. JSFiddle

Any comments or advice would be greatly appreciated.

EDIT: Looking through the source code, this seems to be caused by the [mouse]up event not being successfully caught in Enyo. I'm not sure what could be causing this, though, or what to do about it.

enyo.kind(
{
    name: 'Foo',

    components:
    [
        {
            kind: enyo.Image,
            src:  'http://upload.wikimedia.org/wikipedia/en/e/ed/Nyan_cat_250px_frame.PNG',

            handleDragStart: function(inSender, inEvent) {console.log('bar')},
            handleDragFinish: function(inSender, inEvent) {console.log('quux')},

            handlers:
            {
                ondragstart: 'handleDragStart',
                ondragfinish: 'handleDragFinish',
            },
        }
    ],
});
Was it helpful?

Solution

Problem found. Once I found that the issue was connected to the up event not firing, I searched for solutions to that problem. In doing so, I came across this.

To my fellow Enyoites who stumble across this questions, the solution is to include this code:

        handleDown: function(inSender, inEvent) {inEvent.preventDefault()},

        handlers:
        {
            ondown:       'handleDown',
        },
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top