Skip to content
Snippets Groups Projects
Commit 27eb8ba6 authored by Antoine Guenet's avatar Antoine Guenet
Browse files

[FIX] web_editor, website: never indent/outdent list groups


The "comparisons" website snippet uses a list group with the class set
on a UL. In consequence, the web editor considers it as a regular list
and may try to outdent it, which is not the expected behavior with a
list group. This fix ensures that ULs with the `list-group` class cannot
be in/outdented.

closes odoo/odoo#32709

Signed-off-by: default avatarPierre Paridans <pparidans@users.noreply.github.com>
parent cb9263a8
Branches
Tags
No related merge requests found
......@@ -313,6 +313,10 @@ var BulletPlugin = AbstractPlugin.extend({
if (!range) {
return;
}
// list groups shouldn't be outdented like regular lists
if ($(dom.ancestor(range.sc, dom.isList)).hasClass('list-group')) {
return;
}
var self = this;
var nodes = [];
......
......@@ -2227,6 +2227,18 @@ var keyboardTestsComplex = [{
start: "p:contents()[0]->1",
},
},
{
name: "in ul.list-group (div > p > text before): BACKSPACE at start",
content: '<div><p>1</p></div><ul class="list-group list-group-flush"><li class="list-group-item"><p><br></p></li></ul>',
steps: [{
start: "p:eq(1)->0",
key: 'BACKSPACE',
}],
test: {
content: '<div><p>1</p></div><ul class="list-group list-group-flush"><li class="list-group-item"><p><br></p></li></ul>',
start: "p:eq(1)->0",
},
},
];
QUnit.test('Complex', function (assert) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment