Skip to content

Commit ea7ea0a

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 #6947 Task: 5024825 Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
1 parent 7ad0e33 commit ea7ea0a

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
@@ -174,6 +174,7 @@ export const invalidateBordersCommands = new Set<CommandTypes>([
174174
"AUTOFILL_CELL",
175175
"SET_BORDER",
176176
"SET_ZONE_BORDERS",
177+
"SET_BORDERS_ON_TARGET",
177178
]);
178179

179180
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
@@ -921,4 +921,12 @@ describe("Computed borders", () => {
921921
setZoneBorders(model, { position: "all" }, ["A1"]);
922922
expect(getComputedBorder(model, "A1")).not.toBeNull();
923923
});
924+
925+
test("SET_BORDERS_ON_TARGET command recomputes the borders", () => {
926+
const model = new Model();
927+
const border = { top: DEFAULT_BORDER_DESC };
928+
expect(getComputedBorder(model, "A1")).toBeNull();
929+
setBordersOnTarget(model, ["A1"], border);
930+
expect(getComputedBorder(model, "A1")).not.toBeNull();
931+
});
924932
});

0 commit comments

Comments
 (0)