vue-at icon indicating copy to clipboard operation
vue-at copied to clipboard

BUG? @at event called 2 times

Open gmatkowski opened this issue 6 years ago • 6 comments

There is a bug when @at event is being called 2 times on every new character. <at-ta at="#" :allowSpaces="false" :members="members" @at="handleAt">

image

gmatkowski avatar Jun 13 '18 15:06 gmatkowski

@gmatkowski ahh.. let me have a look. Btw, which browser and version are you using?

fritx avatar Jun 14 '18 10:06 fritx

Chrome 66.0.3359.181, vue-at @ 2.5.0-beta

gmatkowski avatar Jun 14 '18 10:06 gmatkowski

green line i incorrect, not the same time.

gmatkowski avatar Jun 14 '18 10:06 gmatkowski

@gmatkowski oh i'm sorry the bug does exist!

fritx avatar Jun 18 '18 14:06 fritx

Hope you can fix it :-)

gmatkowski avatar Jun 18 '18 14:06 gmatkowski

Created a quickfix for my own app until this has been fixed:

data() {
    return {
        atSearch: '',
    }
}

...


handleAt: function(chunk) {
    // See https://github.com/fritx/vue-at/issues/65
    if (this.atSearch === chunk) {
        return;
    }

    this.atSearch = chunk;

    ...
},

This still calls handleAt twice, but prevents it from doing more logic in the actual method.

phh avatar Jul 31 '18 12:07 phh