Remove input scroll from position (#13569)

* Remove input scroll from position

* Rerun travis
This commit is contained in:
Andrew Bone 2021-04-29 10:00:37 +01:00 committed by GitHub
parent fa38e4bf82
commit 59c7e25e22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,8 +17,8 @@ export const getCursorXY = (input, selectionPoint) => {
const bodyRect = document.body.getBoundingClientRect();
const elementRect = input.getBoundingClientRect();
const inputY = elementRect.top - bodyRect.top;
const inputX = elementRect.left - bodyRect.left;
const inputY = elementRect.top - bodyRect.top - input.scrollTop;
const inputX = elementRect.left - bodyRect.left - input.scrollLeft;
// create a dummy element with the computed style of the input
const div = document.createElement('div');