Fix: prevent browser zoom on touchpad pinch#1335
Open
Unnamed2964 wants to merge 1 commit intorailmapgen:mainfrom
Open
Fix: prevent browser zoom on touchpad pinch#1335Unnamed2964 wants to merge 1 commit intorailmapgen:mainfrom
Unnamed2964 wants to merge 1 commit intorailmapgen:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
至少在我所使用的设备(Surface Pro 8)的 Chromium 浏览器中,在画布上使用触摸板缩放手势,页面也会跟着一起变大。
这是由于 React 默认将
onWheel注册为被动监听器(Passive Listener,为了滚动性能考虑),导致在 React 的事件回调中直接调用e.preventDefault()往往无效或者太晚了(Gemini 3 Pro 生成)。本修改修复了这个问题。