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

fix(line): Ensure null check to avoid Cannot set properties of null (setting 'hoverState') error #20563

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion src/chart/line/LineView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,6 @@ class LineView extends ChartView {

_changePolyState(toState: DisplayState) {
const polygon = this._polygon;
setStatesFlag(this._polyline, toState);
polygon && setStatesFlag(polygon, toState);
Copy link
Author

@svonderohe svonderohe Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the first call to setStatesFlag is not intentional. Removing the call fixes the error I was encountering since the second call has a null check

}

Expand Down
1 change: 1 addition & 0 deletions test/ut/jest.config.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions test/ut/spec/chart/line/LineView.test.ts
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this is the right place to put the tests, if it needs to move please let me know

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better if you can provide a reproduction demo. Please refer to
https://github.com/apache/echarts/wiki/How-to-make-a-pull-request#add-a-test-case

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.