antvis/G2

Do you want to work on this issue?

You can request for a bounty in order to promote it!

BUG: 交互事件冲突 #6036

lxfu1 posted onGitHub

问题描述

  1. 选中 element 后鼠标移入会导致选中被取消
/**
 * A recreation of this demo: https://observablehq.com/@d3/bar-chart
 */
import { Chart } from '@antv/g2';

const chart = new Chart({
  container: 'container',
  autoFit: true,
});

chart
  .interval()
  .data({
    type: 'fetch',
    value:
      'https://gw.alipayobjects.com/os/bmw-prod/fb9db6b7-23a5-4c23-bbef-c54a55fee580.csv',
  })
  .encode('x', 'letter')
  .encode('y', 'frequency')
  .axis('y', { labelFormatter: '.0%' })
  .state({
     unselected: { opacity: 0.5 },
    selected: { fill: "red" },
  })


chart.interaction({
  elementHighlightByColor: {
    background: true
  },
})

chart.render();

重现链接

No response

重现步骤

  1. 鼠标点击选中element
  2. 鼠标再次移入

预期行为

No response

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


background 设置 pointerEvents: none 是不是可以解决?

posted by hustcc over 1 year ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests