From baaf0dd8398f4068846348df7ff015ec5eec80fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Wed, 8 Jul 2020 15:50:10 +0200 Subject: [PATCH 1/2] resolve transition.end() immediately when the selection is empty fixes #105 --- src/transition/end.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/transition/end.js b/src/transition/end.js index 252ce86..65018e7 100644 --- a/src/transition/end.js +++ b/src/transition/end.js @@ -22,5 +22,8 @@ export default function() { schedule.on = on1; }); + + // The selection was empty, resolve end immediately + if (!size) resolve(); }); } From 11d2a9563a724b34098a3b387fb73df1f267fcdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Wed, 8 Jul 2020 18:01:31 +0200 Subject: [PATCH 2/2] size === 0 Co-authored-by: Mike Bostock --- src/transition/end.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transition/end.js b/src/transition/end.js index 65018e7..d9aa373 100644 --- a/src/transition/end.js +++ b/src/transition/end.js @@ -24,6 +24,6 @@ export default function() { }); // The selection was empty, resolve end immediately - if (!size) resolve(); + if (size === 0) resolve(); }); }