From 6672e45ba44f41baacc99ed26554bd228470bf76 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Thu, 3 Sep 2015 18:43:20 +0200 Subject: [PATCH] [FIX] website: better text node if delete and whitespace If the node is a text node containing only empty space, we must replace some of these space by an   so it can be selected. --- addons/website/static/src/js/summernote.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website/static/src/js/summernote.js b/addons/website/static/src/js/summernote.js index f556fd4306a..7f2f11eda72 100644 --- a/addons/website/static/src/js/summernote.js +++ b/addons/website/static/src/js/summernote.js @@ -595,9 +595,9 @@ define(['summernote/editing/Editor', 'summernote/summernote'], function (Editor) sc = $("
")[0]; so = 0; $(ancestor).prepend(sc); - } else if (before) { + } else if (dom.isText(sc)) { var text = sc.textContent.replace(/[ \t\n\r]+$/, '\u00A0'); - so -= sc.textContent.length - text.length; + so = Math.min(so, text.length); sc.textContent = text; }