Skip to content

[Web API type definition issue] Element.requestFullscreen should be optional #2211

@hyunbinseo

Description

@hyunbinseo

Summary

typeof document.documentElement.requestFullscreen is undefined in iOS Safari

Expected vs. Actual Behavior

typeof document.documentElement.requestFullscreen

Expected: not defined in iOS 26.0.1 Safari (and probably in the webview)
Actual: always a function

Playground Link

No response

Browser Support

  • This API is supported in at least two major browser engines (not two Chromium-based browsers).

Have Tried The Latest Releases

  • This issue applies to the latest release of TypeScript.
  • This issue applies to the latest release of @types/web.

Additional Context

Suggested change will enforce optional chaining for safer runtime code.

document.documentElement.requestFullscreen?.()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions