Skip to content

Commit

Permalink
fix(useFullscreen): skip exiting when not in fullscreen mode (#3144)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
Co-authored-by: Fernando Fernández <ferferga@hotmail.com>
  • Loading branch information
3 people committed Jun 28, 2023
1 parent fa7ed3a commit 14edb4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/useFullscreen/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export function useFullscreen(
}

async function exit() {
if (!isSupported.value)
if (!isSupported.value || !isFullscreen.value)
return
if (exitMethod.value) {
if (document?.[exitMethod.value] != null) {
Expand All @@ -134,7 +134,7 @@ export function useFullscreen(
}

async function enter() {
if (!isSupported.value)
if (!isSupported.value || isFullscreen.value)
return

if (isElementFullScreen())
Expand Down

0 comments on commit 14edb4a

Please sign in to comment.