1

I create an iframe in JavaScript and add a drag enter event listener to it. I wrote a small sample here: Codepen

drag.addEventListener("dragenter", dragEnter, false)

It works well in codepen.

My real project is in a chrome extension. I write the same code but the dragenter event works only from left/top boundaries.

Thanks in advance!

Umutambyi Gad
  • 4,082
  • 3
  • 18
  • 39
K.C.
  • 41
  • 1
  • 5

1 Answers1

0

I found the problem is from

border: none;
outline: none;

Also I tested

frameBorder = 0
border = 0

They will affect the dragenter as well.

I don't know if it only happens in chrome extension, and here is my solution

As I need to remove the border, I used

border-color: transparent;

Done!

K.C.
  • 41
  • 1
  • 5