fire top-level events first

This commit is contained in:
Kevin Jahns
2020-10-29 12:40:39 +01:00
parent fd211731cc
commit 4fb9cc2a30
2 changed files with 31 additions and 0 deletions

View File

@@ -284,6 +284,9 @@ const cleanupTransactions = (transactionCleanups, i) => {
.forEach(event => {
event.currentTarget = type
})
// sort events by path length so that top-level events are fired first.
events
.sort((event1, event2) => event1.path.length - event2.path.length)
// We don't need to check for events.length
// because we know it has at least one element
callEventHandlerListeners(type._dEH, events, transaction)