utils/dom/getrangefrommouseevent
module
Functions
getRangeFromMouseEvent( domEvent ) → Range | nullmodule:utils/dom/getrangefrommouseevent~getRangeFromMouseEventReturns a DOM range from a given point specified by a mouse event.
Note: The point is resolved inside the shadow root the event was dispatched in, so a click inside a shadow tree gives a range in that tree rather than one at its host. Works for open and closed shadow roots alike, on the engines that honor the
shadowRootsoption ofDocument#caretPositionFromPoint(); elsewhere the range still lands beside the host.Parameters
domEvent: MouseEvent & objectThe mouse event.
Returns
Range | nullThe DOM range.