eCollect / vue-swipe-actions

iOS style swipe actions
https://ecollect.github.io/vue-swipe-actions/
MIT License
232 stars 47 forks source link

Duplicate mouse event handling Issue #30

Closed Jae-kwang closed 5 years ago

Jae-kwang commented 5 years ago

I get the following error:

{"error":{"name":"TypeError","message":"Cannot read property 'abort' of undefined","stack":"TypeError: Cannot read property 'abort' of undefined at HTMLDivElement.move
{"error":{"name":"TypeError","message":"Cannot read property 'mouse' of undefined","stack":"TypeError: Cannot read property 'mouse' of undefined at HTMLDivElement.end

I'm using a different mouse event than 'vue-swipe-actions'. but another mouse event has not '.event' property. property validation seems to be needed.

nanov commented 5 years ago

Merged and released, although i am not sure how you get into this situation, could you provide an example ( gist/repro ) with which this happens?

Jae-kwang commented 5 years ago

I needed to another swipe event not a 'vue-swipe-actions' on the same component. I decided to use vue2-touch-events at that component. I suspect these two are clashing. because ctx.event is custom property

nanov commented 5 years ago

Hmm, ok I see. I am really not that sure how this two will work together. Maybe you can use the same directive for your others use, and in such manner spare yourself another dependency? I could expose the directive out of the library to allow separate use.

Jae-kwang commented 5 years ago

I don't think you need to expose the directive. It would be better to add more validation or insert an error code in only the suspicious part, such as when the underlying event and the controlling part (in the above case) can overlap. What do you think?

nanov commented 5 years ago

I did merge your PR, and released it ( last week in fact ). Does this solves your problem?

I was just brainstorming.

Jae-kwang commented 5 years ago

My problem has been solved. Thank you for asking.