Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions common/changes/@visactor/vchart/develop_2024-04-18-03-55.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vchart",
"comment": "fix(datazoom): when drag start and end handler outside, min and max span not work. fix#2559",
"type": "none"
}
],
"packageName": "@visactor/vchart"
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,18 @@ export abstract class DataFilterBaseComponent<T extends IDataFilterComponentSpec

protected _handleChange(start: number, end: number, updateComponent?: boolean) {
const zoomLock = this._spec?.zoomLock ?? false;
if (zoomLock || (end - start !== this._spanCache && (end - start < this._minSpan || end - start > this._maxSpan))) {
if (
zoomLock ||
// 拖拽两端的handler, 而非拖拽中间handler
(end - start !== this._spanCache &&
// 拖拽后超出限制范围
(end - start < this._minSpan || end - start > this._maxSpan))
) {
this._shouldChange = false;
} else {
this._shouldChange = true;
this._spanCache = end - start;
}
this._spanCache = end - start;
}

protected _isReverse() {
Expand Down