use body instead of root node

Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
Timo K
2025-08-08 15:37:55 +02:00
parent eaa7020911
commit 708581ea38

View File

@@ -213,7 +213,7 @@ export const SpotlightTile: FC<Props> = ({
const canGoToNext = visibleIndex !== -1 && visibleIndex < media.length - 1;
const isFullscreen = useCallback((): boolean => {
const rootElement = document.getElementById("root");
const rootElement = document.body;
if (rootElement && document.fullscreenElement) return true;
return false;
}, []);
@@ -223,7 +223,7 @@ export const SpotlightTile: FC<Props> = ({
: FullScreenMaximiseIcon;
const onToggleFullscreen = useCallback(() => {
const rootElement = document.getElementById("root");
const rootElement = document.body;
if (!rootElement) return;
if (isFullscreen()) {
void document?.exitFullscreen();