From bb795b04bbee735e5c9b653b5e0fe3cd36ce1388 Mon Sep 17 00:00:00 2001 From: Alexander Gratzl Date: Fri, 29 Nov 2024 12:34:39 +0100 Subject: [PATCH] #472 when inserting an element, correctly place range position AFTER contenteditable=false element instead of inside --- source/range/Boundaries.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/range/Boundaries.ts b/source/range/Boundaries.ts index 2908bc2f..0e928bd1 100644 --- a/source/range/Boundaries.ts +++ b/source/range/Boundaries.ts @@ -157,6 +157,11 @@ const moveRangeBoundariesUpTree = ( } range.setStart(startContainer, startOffset); + + if(!(startContainer as HTMLElement).isContentEditable){ + range.setStart(endContainer, endOffset); + } + range.setEnd(endContainer, endOffset); };