Previously, GojiJS used e.target.dataset to detect whether an event had been stopped or not. However, this approach failed to work when crossing custom component such as Subtree or wrapped components. To improve stability, I have refactored the implementation of stopPropagation using the instance tree ( VDOM tree ).
When stopPropagation is called on an element, GojiJS marks itself and its ancestors as stopped, and they will no longer accept events with the same type and timeStamp. Throughout this process, we assume that events with the same typeandtimeStamp` are dispatched from the same source.
This PR fixed https://github.com/airbnb/goji-js/issues/198
Previously, GojiJS used
e.target.dataset
to detect whether an event had been stopped or not. However, this approach failed to work when crossing custom component such asSubtree
or wrapped components. To improve stability, I have refactored the implementation ofstopPropagation
using the instance tree ( VDOM tree ).When
stopPropagation
is called on an element, GojiJS marks itself and its ancestors as stopped, and they will no longer accept events with the sametype
andtimeStamp
. Throughout this process, we assume that events with the same typeand
timeStamp` are dispatched from the same source.