From b17a2ff6fc8a271c31e412b5f9a2e7e891ff7b30 Mon Sep 17 00:00:00 2001 From: James Gillmore Date: Mon, 28 Aug 2017 15:58:25 -0700 Subject: [PATCH] do not remove element if onLeave handler provided So the real correct way to do this seems to be to fix this function `getHookArgumentsLength`, however it seems that it has a hard time analyzing the number of arguments in the vue-to-react transpilation scheme setup here. I could be wrong, so consider this just an indicator of what needs to be fixed. Essentially, my fix is a weaker assumption: *if there is an `onLeave` handler, it means do not remove the element. However, in a real Vue app, you likely can use such handlers for other things without manually removing the element, which is why `getHookArgumentsLength` exists to smooth things over. My guess is those situations are just edge cases. Most of the time if you are going to provide such a handler you will finish the job and call `done` yourself. Hopefully this can get merged sooner than later, as I'd like to present your repo (since you're the original creator) rather than a fork. --- packages/react-vue-helper/build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-vue-helper/build.js b/packages/react-vue-helper/build.js index f2b64c36af5..67a3a5d4e24 100644 --- a/packages/react-vue-helper/build.js +++ b/packages/react-vue-helper/build.js @@ -3596,7 +3596,7 @@ function leave (ref) { }); } onLeave && onLeave(el, _cb); - if (!expectsCSS && !userWantsControl) { + if (!expectsCSS && !userWantsControl && !onLeave) { _cb(); } }