Skip to content
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
5 changes: 5 additions & 0 deletions .changeset/thick-mice-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@getodk/web-forms': patch
---

Prevent background scroll and browser zooming in full-screen map
3 changes: 3 additions & 0 deletions packages/web-forms/src/assets/styles/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@
/* Overlays like modals, popups, or dialogs above form content */
--odk-z-index-overlay: 100;

/* Floating feedback button */
--odk-z-index-feedback-button: 900;

/* Critical UI elements (e.g., loading spinners, toast notifications) */
--odk-z-index-topmost: 1000;
}
Expand Down
27 changes: 20 additions & 7 deletions packages/web-forms/src/components/common/map/MapBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ const saveAdvancedPanelCoords = (newCoords: Coordinate) => {
border: 1px solid var(--odk-border-color);
border-radius: var(--odk-radius);
overflow: hidden;
// Fixes iPhone select issues on map
// iPhone - fixes select issues on map
-webkit-user-select: none;
user-select: none;
-webkit-touch-callout: none;
Expand Down Expand Up @@ -295,18 +295,31 @@ const saveAdvancedPanelCoords = (newCoords: Coordinate) => {
}

.map-container.map-full-screen {
position: fixed;
inset: 0;
display: flex;
flex-direction: column;
justify-content: flex-start;
position: fixed;
top: 0;
left: 0;
height: 100vh;
width: 100vw;
height: 100dvh;
Copy link
Collaborator

Choose a reason for hiding this comment

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

The dynamic nature of this gave me pause because I was worried it might cause too much re-rendering but I couldn't get it to behave poorly either in Chrome or Firefox. Even if it does trigger it feels smooth.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just learned about dvh/w, and it's a game-changer when working on responsive UI. I love it!

z-index: var(--odk-z-index-topmost);
background: var(--odk-base-background-color);
border-radius: 0;

// Prevent background scroll-chaining
overscroll-behavior: none;
// Hand touch gestures (zoom/pan) exclusively to the map engine
touch-action: none;

.map-block {
flex-grow: 2;
flex: 1 1 0;
width: 100%;
min-height: 0;
height: auto;
}

:deep(.map-status-bar),
:deep(.advanced-panel) {
flex-shrink: 0;
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/web-forms/src/demo/FeedbackButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const surveyLink = computed(() => {
right: 0;
bottom: 150px;
height: 4rem;
z-index: var(--odk-z-index-topmost);
z-index: var(--odk-z-index-feedback-button);
border-top-left-radius: var(--odk-radius);
border-top-right-radius: var(--odk-radius);
text-align: center;
Expand Down