From 0751cd80b1bf9e3fbbb757fd4f6d9c2d2a5e899b Mon Sep 17 00:00:00 2001 From: jGowgiel Date: Sat, 2 Dec 2023 00:04:16 -0800 Subject: [PATCH] Extend the getTargetRanges method documentation (#30718) --- .../api/inputevent/gettargetranges/index.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/files/en-us/web/api/inputevent/gettargetranges/index.md b/files/en-us/web/api/inputevent/gettargetranges/index.md index d975078c4da2492..8cfe5ae723ed2ec 100644 --- a/files/en-us/web/api/inputevent/gettargetranges/index.md +++ b/files/en-us/web/api/inputevent/gettargetranges/index.md @@ -12,6 +12,44 @@ The **`getTargetRanges()`** method of the {{domxref("InputEvent")}} interface re This allows web apps to override text edit behavior before the browser modifies the DOM tree, and provides more control over input events to improve performance. +Depending on the value of `inputType` and the current editing host, the expected return value of this method varies: + + + + + + + + + + + + + + + + + + + + + + + + + + +
inputTypeEditing hostResponse of getTargetRanges()
"historyUndo" or "historyRedo"Anyempty Array
All remainingcontenteditable + an Array of + {{domxref("StaticRange")}} + objects associated with event +
All remaining + input + or textarea + + an empty Array +
+ ## Syntax ```js-nolint