Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release_3_9] Fixing bug about the print overlay stacking #5075

Merged
merged 1 commit into from
Dec 3, 2024
Merged
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
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);
});
});
Loading