Skip to content

Use Intersection Observer API for better performance #510

Closed
@Danielku15

Description

@Danielku15

AlphaTab uses a custom scroll listener for "lazy loading" the generated image chunks into the DOM for smoother UI feedback. This is based on the getBoundingClientRect which is very expensive as it might cause a layout flow in the browser.

The intersection observer API is way more lightweight and provides exactly what we need for lazy loading.

Also this API should be used for detecting the visibility of the element on-load.

https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API

Metadata

Metadata

Assignees

Labels

area-maintenanceOverall code maintenance relatedplatform-javascriptRelated to the JavaScript version of alphaTab

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions