Skip to content

Fix/prevent MazeMap iframe from unintuitive scroll behaviour#531

Open
kristiangjestad wants to merge 1 commit into
vevcom:mainfrom
kristiangjestad:fix/mazemap-scroll-zoom
Open

Fix/prevent MazeMap iframe from unintuitive scroll behaviour#531
kristiangjestad wants to merge 1 commit into
vevcom:mainfrom
kristiangjestad:fix/mazemap-scroll-zoom

Conversation

@kristiangjestad

Copy link
Copy Markdown

Adds a transparent overlay over the MazeMap iframe so page scrolling works normally when passing the map. Clicking the map activates interaction and scolling turns to zooming; pointer leaving the map restores the overlay.

Adds a transparent overlay over the MazeMap iframe so page scrolling
works normally when passing the map. Clicking the map activates
interaction; pointer leaving the map restores the overlay.
@JohanHjelsethStorstad JohanHjelsethStorstad changed the title fix: prevent MazeMap iframe from unintuitive scroll behaviour Fix/prevent MazeMap iframe from unintuitive scroll behaviour Jul 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the UX of the embedded MazeMap by preventing the iframe from hijacking page scroll, using a transparent overlay that enables map interaction only after an explicit click.

Changes:

  • Added an “activation” state to gate iframe interaction behind a click-to-interact overlay.
  • Wrapped the iframe in a positioned container and introduced an absolute overlay layer to intercept pointer/scroll until activated.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/app/_components/MazeMap/MazeMap.tsx Adds overlay + active state so normal page scrolling works until the map is explicitly activated.
src/app/_components/MazeMap/MazeMap.module.scss Adds wrapper/overlay styles to position the iframe and overlay correctly.

Comment on lines +48 to +52
<div
className={style.MazeMapOverlay}
onClick={() => setActive(true)}
title="Klikk for å interagere med kartet"
/>
@JohanHjelsethStorstad

Copy link
Copy Markdown
Member

This is nice. One thing that has nothing to with this but which I would change right away is the default params. should not default to any location if we really want to have it default to Lophtet we should make MazeMapLophtet which binds params

@JohanHjelsethStorstad JohanHjelsethStorstad left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just add this small thing I commented to this PR and also look at copilot's suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants