Home » Android » android – document.elementFromPoint(x,y) – pure JavaScript alternative?

android – document.elementFromPoint(x,y) – pure JavaScript alternative?

Posted by: admin June 15, 2020 Leave a comment

Questions:

On some Android devices (native browser) elementFromPoint() is broken when using the overflow:auto CSS property in many situations, so that it returns a parent (the one with overflow:auto) of the correct element.

Is there a complete, fast replacement/polyfill for that function that resembles the native function, but is written in JavaScript?

I am aware of the offsetXXXXX properties, but when adding scrolling and position/overflow CSS settings things are becoming complex…

How to&Answers: