fix: add touch event propagation prevention to modal panels

Prevent touch events on modal panels and their backdrop from
propagating to the canvas by adding event.stopPropagation() on
panel touch listeners.

This matches the existing behavior for sidebar panels and prevents
OrbitControls from responding to touches on modal overlays.

Acceptance Criteria:
- Touch events on modal panels do not propagate to the canvas
  (event.stopPropagation() on modal and backdrop touch listeners)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jedarden 2026-04-11 03:04:04 -04:00
parent 7a30b99684
commit fabb669136
4 changed files with 37 additions and 3 deletions

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
6da01d477c1fcd68b3350166cdf6a59b7ff1addf
dfcd90b28a8c421476ceb9b731146a5b8f7afa70

View file

@ -2481,6 +2481,7 @@
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
overflow-x: auto;
scrollbar-width: none; /* Firefox */
padding-bottom: env(safe-area-inset-bottom);
}
.hamburger-tabs::-webkit-scrollbar {
@ -2494,6 +2495,7 @@
align-items: center;
justify-content: center;
padding: 12px 16px;
padding-bottom: max(12px, env(safe-area-inset-bottom));
min-width: 70px;
min-height: 64px;
background: none;

View file

@ -337,6 +337,33 @@
modalElement.appendChild(content);
// Add touch event listeners to prevent propagation to canvas
// This prevents OrbitControls from responding to touches on the modal
modalElement.addEventListener('touchstart', function(e) {
e.stopPropagation();
}, { passive: true });
modalElement.addEventListener('touchmove', function(e) {
e.stopPropagation();
}, { passive: false }); // Non-passive to allow preventDefault if needed
modalElement.addEventListener('touchend', function(e) {
e.stopPropagation();
}, { passive: true });
// Also add to backdrop to prevent canvas touches through backdrop
modalBackdrop.addEventListener('touchstart', function(e) {
e.stopPropagation();
}, { passive: true });
modalBackdrop.addEventListener('touchmove', function(e) {
e.stopPropagation();
}, { passive: false });
modalBackdrop.addEventListener('touchend', function(e) {
e.stopPropagation();
}, { passive: true });
// Modal footer (if buttons requested)
if (config.showConfirm || config.showCancel) {
const footer = document.createElement('div');