Skip to content

[BUG] Indicator.override is assigning _prevIndicator to a deep clone making shouldUpdate not working #691

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

Closed
char101 opened this issue Apr 18, 2025 · 2 comments

Comments

@char101
Copy link

char101 commented Apr 18, 2025

In

this._prevIndicator = { ...clone(currentOthers), result }

_prevIndicator is a deep clone, while in

prev.figures !== current.figures ||

attribute like figures are compared using identity. Thus any update to the indicator like toggling visible value will always result in an update.

I think _prevIndicator should be a shallow clone

this._prevIndicator = { ...this }
@char101
Copy link
Author

char101 commented Apr 18, 2025

The same logic applies to Overlay which compares extendData and styles which are objects.

this._prevOverlay = clone(this)

this._prevOverlay.extendData !== this.extendData ||

@char101
Copy link
Author

char101 commented Apr 21, 2025

I was mistaken. Since the override is merged using merge, figures and calcParams which are arrays are overwritten.

@char101 char101 closed this as completed Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant