antvis / antvis/F2

ios饼图设置pieLabel & triggerOn: 'touchend',但是按住饼图短距离滑动的时候会触发 touchend,怎么解决?

Open
#1,330 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
8k
Forks
637
PR merge metrics
No merged PRs in 30d

Description

如题,因不可直接设置 triggerOn: 'click' 触发 onclick 事件,于是设置了 touch end, 但是短距离滑动的时候会触发 touchend,怎么解决?
chart.pieLabel({
// @ts-ignore
labelCfg: function (data, color) {
return {
text: showValue ? ${data.type} ${data.value}% : data.type,
};
},
onClick(e) {
let { data } = e;
_this.props.onTabPieCate(data);
},
triggerOn: 'touchend',
});

Contributor guide

Open the contributing guide

Research direction

Start at the pieLabel configuration shown in the report and reproduce the interaction on iOS with a short drag and a tap. Trace how triggerOn: 'touchend' reaches the onClick callback; done means a short drag does not invoke the callback while a tap still does.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.