[Bug]: Brush X Interaction Stuck When Mouse Leaves Chart Area in Ant Design Charts (G2 Plot)
- Dominant language
- TypeScript
- Stars
- 12.6k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug / 问题描述
When using the brush-x interaction in Ant Design Charts (based on G2), the brush filter remains stuck or active if the user begins a brush action and then moves the mouse outside the chart area before releasing the mouse button.
As a result:
The selected filter range is not cleared or finalized.
The chart remains in a partially filtered or frozen state.
There's no intuitive way for the user to cancel the selection unless they interact with the brush again inside the chart.
### Reproduction link / 复现链接
_No response_
### Steps to Reproduce the Bug or Issue / 重现步骤
1.Set up a chart using the following config:
const config = {
data: [...],
xField: 'date',
yField: 'value',
interactions: [{ type: 'brush-x' }],
};
2.Render the chart using Ant Design Charts (e.g., ).
3.Click and hold inside the chart to start a brush-x drag.
4.While holding the mouse button, move the pointer outside the chart area.
5.Release the mouse button outside the chart.
6.The filter remains stuck, and the brush selection is not cleared.
### Version / 版本
🆕 5.x
### OS / 操作系统
- [ ] macOS
- [x] Windows
- [ ] Linux
- [x] Others / 其他
### Browser / 浏览器
- [x] Chrome
- [x] Edge
- [x] Firefox
- [x] Safari (Limited support / 有限支持)
- [x] IE (Nonsupport / 不支持)
- [x] Others / 其他
Contributor guide
Research direction
Start by reproducing the brush-x interaction with the configuration and steps in the issue, especially releasing the pointer outside the chart. Trace the interaction behavior responsible for the filter state. Done means the selection is finalized or cleared when the pointer is released outside the chart, without leaving the chart frozen or partially filtered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100