Skip to content

Commit

Permalink
[FIX] composer: topbar composer z-index
Browse files Browse the repository at this point in the history
The topbar composer has a big z-index, so its formula assistant
is displayed above the rest.

But this z-index is useless when the composer is not focused. In fact,
it causes problems in further versions where we end up with grid
popovers being displayed below the composer.

Also the css to color the border blue when the composer is focused
wasn't working.

closes #5330

Task: 4246966
X-original-commit: b6a0772
Signed-off-by: Adrien Minne (adrm) <[email protected]>
Signed-off-by: Rémi Rahir (rar) <[email protected]>
  • Loading branch information
hokolomopo committed Dec 6, 2024
1 parent 4133585 commit 3fdd729
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ css/* scss */ `
height: fit-content;
margin-top: -1px;
border: 1px solid;
z-index: ${ComponentsImportance.TopBarComposer};
font-family: ${DEFAULT_FONT};
.o-composer:empty:not(:focus):not(.active)::before {
Expand Down Expand Up @@ -92,6 +91,7 @@ export class TopBarComposer extends Component<any, SpreadsheetChildEnv> {
}
return cssPropertiesToCss({
"border-color": SELECTION_BORDER_COLOR,
"z-index": String(ComponentsImportance.TopBarComposer),
});
}

Expand Down
5 changes: 4 additions & 1 deletion tests/spreadsheet/spreadsheet_component.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,10 @@ describe("Simple Spreadsheet Component", () => {
const gridComposerZIndex = getZIndex("div.o-grid-composer");
const highlighZIndex = getZIndex(".o-highlight");

await typeInComposerTopBar("=SUM(A1,A2)");
const inactiveTopBarComposerZIndex = getZIndex(".o-topbar-composer .o-composer-container");
expect(inactiveTopBarComposerZIndex).toBe(0);

await simulateClick(".o-topbar-composer .o-composer");
const topBarComposerZIndex = getZIndex(".o-topbar-composer");

createChart(model, { type: "bar" }, "thisIsAnId");
Expand Down

0 comments on commit 3fdd729

Please sign in to comment.