Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export abstract class AbstractComposerStore extends SpreadsheetStore {
}
this.selectionStart = start;
this.selectionEnd = end;
this.editionMode = "editing";
this.stopComposerRangeSelection();
this.computeFormulaCursorContext();
this.computeParenthesisRelatedToCursor();
this.updateAutoCompleteProvider();
Expand Down
10 changes: 10 additions & 0 deletions tests/composer/composer_integration_component.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
getElComputedStyle,
gridMouseEvent,
keyDown,
keyUp,
rightClickCell,
selectColumnByClicking,
simulateClick,
Expand Down Expand Up @@ -361,6 +362,15 @@ describe("Composer interactions", () => {
expect(composerStore.editionMode).toBe("inactive");
});

test("should switch topbar composer from editing to inactive when pressing Escape on cell A1 containing '=A2'", async () => {
setCellContent(model, "A1", "=A2");
await click(fixture, ".o-spreadsheet-topbar .o-composer");
expect(composerStore.editionMode).toBe("editing");
keyDown({ key: "Escape" });
keyUp({ key: "Escape" });
expect(composerStore.editionMode).toBe("inactive");
});

test("ArrowKeys will move to neighbour cell, if not in contentFocus mode (left/right)", async () => {
let composerEl: Element;
composerEl = await startComposition("a");
Expand Down
6 changes: 6 additions & 0 deletions tests/composer/composer_store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ describe("edition", () => {
expect(composerStore.editionMode).toBe("inactive");
});

test("should keep edition mode inactive when selection changes while composer is inactive", () => {
expect(composerStore.editionMode).toBe("inactive");
composerStore.changeComposerCursorSelection(0, 0);
expect(composerStore.editionMode).toBe("inactive");
});

test("should switch to editing mode when composer cursor selection changes", () => {
composerStore.startEdition("=sum(");
expect(composerStore.editionMode).toBe("selecting");
Expand Down