Skip to content

feat: implement fine-tuned debounce settings#746

Merged
KingSora merged 1 commit into
KingSora:masterfrom
Luc-vr:feat/debounce-options
Nov 23, 2025
Merged

feat: implement fine-tuned debounce settings#746
KingSora merged 1 commit into
KingSora:masterfrom
Luc-vr:feat/debounce-options

Conversation

@Luc-vr

@Luc-vr Luc-vr commented Nov 18, 2025

Copy link
Copy Markdown
Contributor

As mentioned in #744, CSS height or width transitions can cause severe animation jank. This is because the ResizeObserver fires on every frame and, by default, updates immediately to ensure responsiveness, causing layout thrashing.

This PR refactors the update.debounce option to support a fine-tuned object structure: { resize, mutation, event }.

This allows users to specifically debounce resize events (e.g., debounce: { resize: 333 }) to prevent jank during animations, while keeping mutations responsive.

To ensure current configurations don't break, this change is backwards compatible. Legacy inputs (passing a number or tuple directly) are preserved and automatically mapped to the mutation debounce to match previous behavior.

@KingSora KingSora merged commit edab49e into KingSora:master Nov 23, 2025
@KingSora

Copy link
Copy Markdown
Owner

@Luc-vr Thanks, I'll make a few more improvements to your code before I release it.

Excellent work! :)

@KingSora KingSora mentioned this pull request Nov 23, 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

Successfully merging this pull request may close these issues.

2 participants