fix(editor): 避免惯性滚动误触发字号缩放 - #7199
Merged
Merged
Conversation
Owner
|
Thanks for the contribution! Merged in a6c386a, will be released in the next version. |
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.
问题
macOS 触控板滚动存在惯性事件。用户先普通滚动 SQL 编辑器,再在惯性尚未结束时按下 Cmd(例如准备 Cmd+Tab),后续惯性
wheel事件会带上metaKey。现有实现逐事件检查修饰键,因此会把同一普通滚动手势的尾部误判成 Cmd+滚轮缩放,意外改变编辑器字号。修复
实际验证
在 MySQL 8.4 查询编辑器中通过浏览器底层滚轮事件复现和回归:
13px -> 13.8px13px -> 13px13px -> 13.8px,反向滚动恢复13px检查
pnpm exec vitest run apps/desktop/src/lib/__tests__/editor/editorZoom.spec.ts apps/desktop/src/components/nacos/__tests__/NacosAdminConsoleLayout.spec.ts:34 项通过pnpm typecheck:通过pnpm lint:通过(仅仓库既有 warning)pnpm exec oxfmt --check ...:通过node scripts/sync-connection-types.mjs --check:通过pnpm check的全量 Vitest 子进程在无 CPU 活动时未自行退出,因此未将全量检查标记为通过;上述定向测试均正常退出Fixes #4430