Skip to content

Commit

Permalink
Fixing bug about the print overlay stacking (#5069)
Browse files Browse the repository at this point in the history
* FIX: Remove print overlay when change minidock

fix #5068
  • Loading branch information
neo-garaix authored and rldhont committed Dec 3, 2024
1 parent 239500d commit 62d5bf1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions assets/src/components/Print.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ export default class Print extends HTMLElement {
mainLizmap.map.getView().on('change:resolution', this._onChangeResolution);

render(this._template(), this);
} else if (e.navElements.includes('print nav-minidock active')) { // Remove print overlay when clicking on another minidock
mainLizmap.map.removeToolLayer(this._maskLayer);
mainLizmap.map.getView().un('change:resolution', this._onChangeResolution);
}
},
minidockclosed: (e) => {
Expand Down
8 changes: 8 additions & 0 deletions tests/end2end/playwright/print.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,4 +697,12 @@ test.describe('Error while printing', () => {

await expect(page.locator("#message > div:last-child")).toHaveClass(/alert-error/);
});

test('Remove print overlay when switching to another minidock', async ({ page }) => {
await page.locator('#button-print').click();

await page.locator('#button-selectiontool').click();

await expect(page.locator('.ol-unselectable > canvas')).toHaveCount(0);
});
});

0 comments on commit 62d5bf1

Please sign in to comment.