Answer the question
In order to leave comments, you need to log in
Angular overwrites native events?
The D3.js based library is used in the Angular application. In this library, visual elements and their events are created through d3.js. For example: zoom and click are assigned to the main container element, in which the first is responsible for moving and increasing / decreasing the block, and clicking is used to open the menu. It is logical that only the event when we pressed LMB in one place is considered a click. This is exactly what happens in a normal environment (not Angular). But in Angular, the following behavior is observed - click fires even when a move has been made (via the zoom module), namely when the LMB is dropped.
I immediately suspected Angular and its intervention in events, but this happens even with ViewEncapsulation.None. If you try to remove an event listener via devtools in a normal environment (select an element -> Event Listeners), then it will no longer work. But with the same code embedded in Angular, this does not work - the event is both listened to and continues. So, angular overwrites events somewhere? But where? And is it possible to disable this somehow by making a certain block in the component isolated from the influence of angular?
You can try an example here: https://github.com/Ni55aN/D3NE-examples/tree/maste...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question