Vue: Inconsistent order of events

Created on 12 Feb 2019  路  3Comments  路  Source: vuejs/vue

Version

2.6.5

Reproduction link

https://jsfiddle.net/8g1nh5rc/1/

Steps to reproduce

  1. When I click 'Show panel' button , it logs clicked outside

What is expected?

For the first click, it should not invoke v-click-outside event handlers

What is actually happening?

When I click the button, it invokes the v-click-outside handler eagerly.


I have filed the issue here rather in the v-click-outside because I suspect it is because of scheduling of micro-tasks because it used to work fine for older versions of Vue (https://jsfiddle.net/amw9rfhq)

Most helpful comment

Well, it's surely related to our revert of the way we handle micro/macro tasks.

But that revert was necessary to avoid other, more common issues that the change in 2.5 introduced.

And since all we did was revert to the pre-2.5 behaviour, the lib you are using is also failing with any version before 2.5:

https://jsfiddle.net/Linusborg/7c4pw20v/

We're aware that this is in a grey area between a bugfix and a breaking change, but it was necessary as best as we could tell. So it has to be fixed in the library.

All 3 comments

It's the library since v-clickaway works correctly: https://jsfiddle.net/sz8jLn5e/

Well, it's surely related to our revert of the way we handle micro/macro tasks.

But that revert was necessary to avoid other, more common issues that the change in 2.5 introduced.

And since all we did was revert to the pre-2.5 behaviour, the lib you are using is also failing with any version before 2.5:

https://jsfiddle.net/Linusborg/7c4pw20v/

We're aware that this is in a grey area between a bugfix and a breaking change, but it was necessary as best as we could tell. So it has to be fixed in the library.

@posva and @LinusBorg .. that was very helpful .. thank you !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

loki0609 picture loki0609  路  3Comments

fergaldoyle picture fergaldoyle  路  3Comments

franciscolourenco picture franciscolourenco  路  3Comments

paceband picture paceband  路  3Comments

wufeng87 picture wufeng87  路  3Comments