Skip to content

[Feature]: natively support and document safe area insets #8121

@tafelnl

Description

@tafelnl

Description

Now that all chromium bugs (including IME related ones) seem to be resolved around the safe area insets, we should have native support and documentation

Platforms

  • iOS
  • Android
  • Web

Request or proposed solution

As per this update all safe area inset issues (including the ones related to the IME) should be resolved in the next version of chromium. We should have native support for this in Capacitor. I think it makes sense to include this in the core capacitor code without the developer needing to install a plugin or even passing any config values.

Possible solution: we should check for the chromium versions and then do the following logic:

  • If webview lower than the one that has all issues fixed (probably 140) do something like what adjustMarginsForEdgeToEdge already does
  • Otherwise, do nothing, and let the user handle the safe area insets
    • Even better would be to check for the viewport-fit=cover value and only then do nothing. This makes the behavior consistent across web, iOS and Android

Alternatives

No response

Additional Information

With this change the community can sunset all safe area/edge to edge related plugins. It would also close a lot of open issues.

We could also make this issue the overarching issues of all related ones, and close those already. A few related ones I found include:

#8095
#8055
#8103
#8093
#7951

Additionally, it would be great to add some (source of truth) documentation about the safe area insets, as this chromium bug has probably caused quite some confusion among developers

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