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

Improve the grid responsiveness by caching and reusing the last… #872

Conversation

adrian3de
Copy link
Contributor

The getGridColumnStyle and getGridRowStyle methods from GridsterRenderer service that are used in HTML through ngStyle directive are not optimized and in some cases is crashing the app and browser by continuously calling these two methods over and over, and reason of this is that these methods are returning a new objects every time and Angular understands that there is a change and this process never stops.
To improve this behavior I added a cache for the last calculated style and reuse the last style if not changed.

This issue was discovered in a hybrid Angular project with AngularJs and Angular 14 and the problem occurred only on downgraded gridster components, while on components not downgraded was working as expected. I suspect that this is caused by different ways of handling change detections and rendering between AngularJs and Angular 14.

@tiberiuzuld tiberiuzuld merged commit c845907 into tiberiuzuld:master Mar 21, 2023
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

Successfully merging this pull request may close these issues.

2 participants