[Bug] The dispatch opens brush mode in a mousedown callback, requiring a second click to brush, and when the brush is closed and opened again in mousedown, a brush area suddenly appears without the mouse moving
- Dominant language
- TypeScript
- Stars
- 67.3k
- Forks
- 19.8k
- Avg merge
- 15h 17m
- Merged PRs (30d)
- 5
Description
### Version
5.6.0
### Link to Minimal Reproduction
https://codepen.io/xiaozhizhi666/pen/vEYRMGb
### Steps to Reproduce
1.Create a chart with brush selection, both x and y axis can be scaled, the left mouse button to open the brush selection mode, by listening to brushEnd to get the brush selection area, and then zoom into the area; Right-click the mouse to turn off brush mode, and hold down to move the mouse to pan the chart
2.The configuration items and code are visible in the codepen link and the html file below, which can be opened directly in a browser to reproduce this functionality
3.
As described in the title: when the left mouse button is pressed, the brush selection mode is opened, but the brush selection mode is just opened, and the mouse selection area can not be dragged directly, only the second click can be brushed; When the right mouse button is pressed to close the brush selection mode, the chart can be translated, but when the left mouse button is pressed again to open the brush selection mode, a brush selection area suddenly appears before the mouse is moved
### Current Behavior
As described in the title: when the left mouse button is pressed, the brush selection mode is opened, but the brush selection mode is just opened, and the mouse selection area can not be dragged directly, only the second click can be brushed; When the right mouse button is pressed to close the brush selection mode, the chart can be translated, but when the left mouse button is pressed again to open the brush selection mode, a brush selection area suddenly appears before the mouse is moved
https://github.com/user-attachments/assets/08a46d91-d73a-404e-961a-b0f22cead086
### Expected Behavior
When the left mouse button is clicked to trigger the monitoring event, the brush selection mode can be opened and the mouse can be dragged to complete the brush selection; When I click the right mouse button to close the brush selection, and then click the left mouse button again to open the brush selection mode, don't suddenly appear a brush selection area, but let me drag the mouse to select the area;
### Environment
```markdown
- OS:Windows 11 23H2
- Browser:edge 134.0.3124.72
- Framework: html
```
### Any additional comments?
_No response_
Contributor guide
Research direction
Start with the linked CodePen minimal reproduction and the HTML example, then trace the brush-selection and mousedown handling involved in opening and closing brush mode. Reproduce both reported sequences and verify that the first left-button drag selects immediately and reopening brush mode does not create an area before movement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data-visualization, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100