Skip to content

Commit f4607ea

Browse files
rrahirLucasLefevre
authored andcommitted
[FIX] borders: Recompute borders on SET_BORDERS_ON_TARGET
The new command, notably used in the clipboard paste and autofill, was not added to the subset of commands that invalidate the computed border style. closes #7006 Task: 5024825 X-original-commit: ea7ea0a Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
1 parent 746217a commit f4607ea

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/types/commands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ export const invalidateBordersCommands = new Set<CommandTypes>([
180180
"AUTOFILL_CELL",
181181
"SET_BORDER",
182182
"SET_ZONE_BORDERS",
183+
"SET_BORDERS_ON_TARGET",
183184
]);
184185

185186
export const readonlyAllowedCommands = new Set<CommandTypes>([

tests/borders/border_plugin.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,4 +1005,12 @@ describe("Computed borders", () => {
10051005
setZoneBorders(model, { position: "all" }, ["A1"]);
10061006
expect(getComputedBorder(model, "A1")).not.toBeNull();
10071007
});
1008+
1009+
test("SET_BORDERS_ON_TARGET command recomputes the borders", () => {
1010+
const model = new Model();
1011+
const border = { top: DEFAULT_BORDER_DESC };
1012+
expect(getComputedBorder(model, "A1")).toBeNull();
1013+
setBordersOnTarget(model, ["A1"], border);
1014+
expect(getComputedBorder(model, "A1")).not.toBeNull();
1015+
});
10081016
});

0 commit comments

Comments
 (0)