Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 230580

Certain HTML DOM Events don't fire

$
0
0

I have a file drop location that I want to enable drag and drop capabilities on, but I cannot for the life of me get it to fire when using the ‘drop’ event. If I change the event to ‘click’ however, I can get an output from the callback.
This is the relevant TS code:

ngAfterViewInit() {
    this.elRef.nativeElement.querySelector('.drop').addEventListener('drop', (event) => {
      event.preventDefault();
      console.log('click');
    });
  }

Here is the HTML element:

<ion-item class="drop">
</ion-item>

Viewing all articles
Browse latest Browse all 230580

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>