Skip to content

Commit

Permalink
[FIX] BottomBarSheet: renaming a sheet with styled content
Browse files Browse the repository at this point in the history
Modified the span element to be contenteditable in plain-text only,
resolving the traceback issue during sheet renaming.

Task:: 3621086

closes #3351

Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
  • Loading branch information
dhrp-odoo committed Jan 26, 2024
1 parent 960baf5 commit 495c839
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/bottom_bar_sheet/bottom_bar_sheet.xml
Expand Up @@ -19,7 +19,7 @@
t-on-dblclick="() => this.onDblClick()"
t-on-focusout="() => this.onFocusOut()"
t-on-keydown="(ev) => this.onKeyDown(ev)"
t-att-contenteditable="state.isEditing.toString()"
t-att-contenteditable="state.isEditing ? 'plaintext-only': 'false'"
/>
<span class="o-sheet-icon ms-1" t-on-click.stop="(ev) => this.onIconClick(ev)">
<t t-call="o-spreadsheet-Icon.TRIANGLE_DOWN"/>
Expand Down
4 changes: 2 additions & 2 deletions tests/components/bottom_bar.test.ts
Expand Up @@ -244,7 +244,7 @@ describe("BottomBar component", () => {
expect(sheetName.getAttribute("contenteditable")).toEqual("false");
triggerMouseEvent(sheetName, "dblclick");
await nextTick();
expect(sheetName.getAttribute("contenteditable")).toEqual("true");
expect(sheetName.getAttribute("contenteditable")).toEqual("plaintext-only");
expect(document.activeElement).toEqual(sheetName);
});

Expand All @@ -253,7 +253,7 @@ describe("BottomBar component", () => {
await nextTick();
await click(fixture, ".o-menu-item[data-name='rename'");
const sheetName = fixture.querySelector<HTMLElement>(".o-sheet-name")!;
expect(sheetName.getAttribute("contenteditable")).toEqual("true");
expect(sheetName.getAttribute("contenteditable")).toEqual("plaintext-only");
expect(document.activeElement).toEqual(sheetName);
});

Expand Down

0 comments on commit 495c839

Please sign in to comment.