Skip to content

Better save handling when the application is invisible or is unmounting#81

Merged
lauslim12 merged 2 commits intomainfrom
better-handle-save-on-unmount
Mar 6, 2026
Merged

Better save handling when the application is invisible or is unmounting#81
lauslim12 merged 2 commits intomainfrom
better-handle-save-on-unmount

Conversation

@lauslim12
Copy link
Copy Markdown
Owner

Use Document.visibilityState to check whether the document is in the background or minimized window. Supported by all modern browsers.

In case the API above is not available, fallback to window.pagehide event.

What we do is that we try to invoke the debounce if the application is hidden or is being unmounted.

Base automatically changed from fix-scrollbars-in-edge-cases to main March 6, 2026 15:02
@lauslim12 lauslim12 merged commit e23ec37 into main Mar 6, 2026
2 checks passed
@lauslim12 lauslim12 deleted the better-handle-save-on-unmount branch March 6, 2026 16:14
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.

1 participant