You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project sounds great but I can't tell why this is better than window.getSelection().getRangeAt(0).getBoundingClientRect()? Are there cases where that fails but this library works?
If so, I think that it would be great to cover this in the readme.
The text was updated successfully, but these errors were encountered:
@malcolmredheron How do you use window.getSelection().getRangeAt(0).getBoundingClientRect()? I could never get it to work. It always gives me { bottom: 0, height: 0, left: 0, right:0, top: 0, width: 0, x: 0, y: 0 }
.getBoundingClientRect() doesn't appear to work for a selection inside a textarea unless I'm mistaken. I see the same behaviour as @tnhu when trying to swap out getCaretCoordinates(el, el.selectionStart) for window.getSelection().getRangeAt(0).getBoundingClientRect()
It does seem to work for selections in normal divs etc.
This project sounds great but I can't tell why this is better than
window.getSelection().getRangeAt(0).getBoundingClientRect()
? Are there cases where that fails but this library works?If so, I think that it would be great to cover this in the readme.
The text was updated successfully, but these errors were encountered: