diff --git a/src/components/bottom_bar/bottom_bar.ts b/src/components/bottom_bar/bottom_bar.ts index 52d0f49450..c900b18535 100644 --- a/src/components/bottom_bar/bottom_bar.ts +++ b/src/components/bottom_bar/bottom_bar.ts @@ -50,10 +50,6 @@ css/* scss */ ` .o-bottom-bar-arrows { .o-bottom-bar-arrow { cursor: pointer; - &.o-disabled { - opacity: 0.4; - cursor: default; - } &:hover:not([class*="o-disabled"]) { .o-icon { opacity: 0.9; diff --git a/src/components/spreadsheet/spreadsheet.ts b/src/components/spreadsheet/spreadsheet.ts index 79b73b6fc4..24593dcc10 100644 --- a/src/components/spreadsheet/spreadsheet.ts +++ b/src/components/spreadsheet/spreadsheet.ts @@ -54,6 +54,11 @@ css/* scss */ ` button { color: #333; } + .o-disabled { + opacity: 0.4; + pointer: default; + pointer-events: none; + } &, *, diff --git a/src/components/top_bar/top_bar.ts b/src/components/top_bar/top_bar.ts index 899223b5b3..1614da0ab1 100644 --- a/src/components/top_bar/top_bar.ts +++ b/src/components/top_bar/top_bar.ts @@ -184,11 +184,6 @@ css/* scss */ ` margin: 0 6px; } - .o-disabled { - opacity: 0.6; - cursor: default; - } - .o-dropdown { position: relative; display: flex; diff --git a/tests/model.test.ts b/tests/model.test.ts index 81075265ef..6dd73b923f 100644 --- a/tests/model.test.ts +++ b/tests/model.test.ts @@ -129,10 +129,13 @@ describe("Model", () => { CommandResult.CancelledForUnknownReason ); - expect(model.canDispatch("UPDATE_CELL", { sheetId: "42", col: 0, row: 0, content: "hey" })) - .toBeSuccessfullyDispatched; - expect(model.dispatch("UPDATE_CELL", { sheetId: "42", col: 0, row: 0, content: "hey" })) - .toBeSuccessfullyDispatched; + const sheetId = model.getters.getActiveSheetId(); + expect( + model.canDispatch("UPDATE_CELL", { sheetId, col: 0, row: 0, content: "hey" }) + ).toBeSuccessfullyDispatched(); + expect( + model.dispatch("UPDATE_CELL", { sheetId, col: 0, row: 0, content: "hey" }) + ).toBeSuccessfullyDispatched(); corePluginRegistry.remove("myCorePlugin"); });