utils/dom/isdomselectionbackward
module
Functions
isDomSelectionBackward( selection ) → booleanmodule:utils/dom/isdomselectionbackward~isDomSelectionBackwardReturns
trueif the given selection is backward, that is, if itsfocusis positioned before itsanchor.A replacement for reading
Selection#direction, which is absent on older engines and reports'none'for a selection made with the mouse inside a shadow root. The orientation is then recovered from the anchor and focus positions instead, so an answer is always available.Parameters
selection: Selection | ShadowSelectionThe selection to check.
Returns
boolean