Drop file problem

I am experiencing issues with the “drop file” feature. In order for it to work properly, I must only hover my mouse over the first line. Otherwise, the file opens in the next browser tab.
But it works codemirror v5. What could be causing this problem?

Might help a lot to mention what browser and OS you are using, and provide an example setup in which this reproduces.

I tested it in a basic configuration.

I would like to make something like that when the user drops a file onto the editor.
Actually, it would be enough for me if the problem in the first photograph is fixed.

Ah, that clarifies it. It’s not about the first line, but about dropping below the last line of the document. This patch should help.