FE-657: prevent browser zoom on ctrl+wheel in mask editor (#12215)

## Summary

Wheel events on the mask editor pointer zone now call preventDefault,
matching the main canvas behavior so ctrl+wheel only zooms the mask
canvas instead of also triggering page zoom.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-12215-FE-657-prevent-browser-zoom-on-ctrl-wheel-in-mask-editor-35f6d73d36508131a9b8dbf2f6640d72)
by [Unito](https://www.unito.io)
This commit is contained in:
Terry Jia
2026-05-13 18:24:22 -04:00
committed by GitHub
parent 9cc09cd46c
commit f7ef563b46
2 changed files with 16 additions and 1 deletions

View File

@@ -141,6 +141,21 @@ describe('PointerZone', () => {
y: 45
})
})
it('should preventDefault on wheel to block browser zoom on ctrl+wheel', () => {
renderZone()
const zone = getZone()
const event = new WheelEvent('wheel', {
bubbles: true,
cancelable: true,
deltaY: -1,
ctrlKey: true
})
zone.dispatchEvent(event)
expect(event.defaultPrevented).toBe(true)
})
})
describe('isPanning watcher', () => {

View File

@@ -11,7 +11,7 @@
@touchstart="handleTouchStart"
@touchmove="handleTouchMove"
@touchend="handleTouchEnd"
@wheel="handleWheel"
@wheel.prevent="handleWheel"
@contextmenu.prevent
/>
</template>