[FIX] web_editor: changing header style keep its text alignment
Before this commit: changing header style, changes the alignment of the selection After this commit: Now after applying header on selection it doesnot changes its alignment. Task-2641462 closes odoo/odoo#99358 X-original-commit: da8d2669b03e1016dc05f031a2a7ac840541962e Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
@@ -586,7 +586,12 @@ export const editorCommands = {
|
||||
) {
|
||||
setSelection(block, 0, block, nodeSize(block));
|
||||
editor.historyPauseSteps();
|
||||
// Keep the alignment and remove rest of the applied styles.
|
||||
const textAlign = block.style.textAlign;
|
||||
editor.execCommand('removeFormat');
|
||||
if (textAlign) {
|
||||
block.style.textAlign = textAlign;
|
||||
}
|
||||
editor.historyUnpauseSteps();
|
||||
const inLI = block.closest('li');
|
||||
if (inLI && tagName === "P") {
|
||||
|
||||
Reference in New Issue
Block a user