How to monitor whether it is in full-screen mode? #7823
Unanswered
openapphub
asked this question in
Q&A
Replies: 1 comment 3 replies
|
Trilium doesn't provide a built-in frontend API or event for monitoring full-screen mode changes. However, you can use the browser's Fullscreen API to listen for changes. For example, you can add an event listener for fullscreen changes and update your component state accordingly: useEffect(() => {
function handleFullscreenChange() {
setIsFullscreen(!!document.fullscreenElement);
}
document.addEventListener('fullscreenchange', handleFullscreenChange);
return () => {
document.removeEventListener('fullscreenchange', handleFullscreenChange);
};
}, []);You can then conditionally render components based on the To reply, just mention @dosu. Docs are dead. Just use Dosu. |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
On a whim, certain components can be displayed when in full-screen mode, and they can be hidden when not in full-screen. Is there a way for the frontend API to listen for this?
All reactions