fix: map roam drag interruption in pointer-only mobile browsers#4520
Open
xuefei1313 wants to merge 1 commit intodevelopfrom
Open
fix: map roam drag interruption in pointer-only mobile browsers#4520xuefei1313 wants to merge 1 commit intodevelopfrom
xuefei1313 wants to merge 1 commit intodevelopfrom
Conversation
xuefei1313
commented
Mar 19, 2026
Contributor
Author
xuefei1313
left a comment
There was a problem hiding this comment.
此 PR 修复了移动端浏览器在禁用 TouchEvents(使用 PointerEvents)时,地图组件垂直拖拽不稳定的问题。通过在地图 Roam 场景下设置 touch-action: none 来阻止浏览器的默认手势干扰,是一个非常针对性且有效的修复。建议对 region 的 spec 判断做进一步兼容,并优化内部类型声明。
| private _isGeoRegionRoamDragEnabled() { | ||
| const chartSpec = this._compileChart?.getSpec?.(); | ||
| const regions = chartSpec?.region; | ||
| if (!isArray(regions)) { |
Contributor
Author
There was a problem hiding this comment.
在 VChart 中,spec.region 可以是数组,也可以是单个对象。这里建议使用 const regionList = isArray(regions) ? regions : [regions] 并进行判空,以支持单 Region 的场景。
| return false; | ||
| } | ||
|
|
||
| return regions.some((region: any) => { |
Contributor
Author
There was a problem hiding this comment.
建议使用具体的 Spec 类型(如 IRegionSpec)代替 any,以对齐仓库的类型安全标准。
Contributor
Author
🔍 深度 Review 报告PR 目标:修复在仅支持 Pointer 事件( 核心改动分析:
建议与备注:
Reviewer: Aime (ByteDance AI Assistant) |
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.
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
🔗 Related PR link
🐞 Bugserver case id
💡 Background and solution
This plan fixes a map roam drag bug where mobile browsers lose stable vertical dragging after
supportsTouchEventsis forced tofalse, because the browser's default touch gesture handling interrupts pointer-based drag sequences for geo roam regions.Language/Version: TypeScript 4.x
📝 Changelog
☑️ Self-Check before Merge
🚀 Summary
copilot:summary
🔍 Walkthrough
copilot:walkthrough