Skip to content

Commit

Permalink
fix: handle Safari iOS fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
ferferga committed Mar 1, 2023
1 parent 320abd7 commit 8bd49b0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/core/useFullscreen/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ const functionsMap: FunctionMap[] = [
'webkitfullscreenchange',
'webkitfullscreenerror',
],
// Safari iOS WebKit
[
'webkitEnterFullscreen',
'webkitExitFullscreen',
'webkitFullscreenElement',
'webkitFullscreenEnabled',
'webkitfullscreenchange',
'webkitfullscreenerror',
],
// Old WebKit
[
'webkitRequestFullScreen',
Expand Down Expand Up @@ -95,7 +104,7 @@ export function useFullscreen(
}
else {
for (const m of functionsMap) {
if (m[1] in document) {
if (m[1] in document || m[1] in unrefElement(targetRef)) {
map = m
return true
}
Expand Down

0 comments on commit 8bd49b0

Please sign in to comment.