Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] When trigger scrollbar, the click event will be stopped #2333

Closed
kkxxkk2019 opened this issue Mar 7, 2024 · 1 comment · Fixed by #2346
Closed

[Bug] When trigger scrollbar, the click event will be stopped #2333

kkxxkk2019 opened this issue Mar 7, 2024 · 1 comment · Fixed by #2346
Assignees
Labels
bug Something isn't working high priority

Comments

@kkxxkk2019
Copy link
Collaborator

Version

lastest

Link to Minimal Reproduction

none

Steps to Reproduce

const spec = {
    type: 'bar',
    data: [
      {
        id: 'barData',
        values: [
          { year: '2000', sales: 22 },
          { year: '2001', sales: 13 },
          { year: '2002', sales: 25 },
          { year: '2003', sales: 29 },
          { year: '2004', sales: 38 },
          { year: '2005', sales: 49 },
          { year: '2006', sales: 58 },
          { year: '2007', sales: 29 },
          { year: '2008', sales: 78 },
          { year: '2009', sales: 19 },
          { year: '2010', sales: 23 },
          { year: '2011', sales: 20 },
          { year: '2012', sales: 98 },
          { year: '2013', sales: 49 },
          { year: '2014', sales: 28 }
        ]
      }
    ],
    direction: 'horizontal',
    yField: 'year',
    xField: 'sales',
    scrollBar: [
      {
        orient: 'right',
        startValue: '2011',
        endValue: '2014',
        roam: true,
      }
    ]
  };
  // 两次动画
  // 滚动条不能再滚动条上拖拽
  const vchart = new VChart(spec, { dom: CONTAINER_ID });
  vchart.on('click', { nodeName: 'axis-label' }, e => {
    console.log('===click');
  });
  vchart.renderSync();
  // Just for the convenience of console debugging, DO NOT COPY!
  window['vchart'] = vchart;

Current Behavior

触发滚动条滚动后,在 vchart 上注册的 click 事件就不能触发了,调试下来发现是被 scrollbar 上的事件阻止冒泡了,需要排查下是否 _clickEnable 这个参数忘记在某个地方置为 true 了

return !this._clickEnable;

Expected Behavior

fix it

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@kkxxkk2019 kkxxkk2019 added the bug Something isn't working label Mar 7, 2024
@kkxxkk2019
Copy link
Collaborator Author

用户期望今天修复

@skie1997 skie1997 mentioned this issue Mar 7, 2024
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants