Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49290

Certain HTML DOM Events don't fire

$
0
0

@hillad wrote:

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>

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49290

Trending Articles



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