Skip to content

[Feature]: use native safe area insets #8343

@tafelnl

Description

@tafelnl

Description

Deprecate the old way of using safe area insets (custom vars) and use the native approach instead

Platforms

  • iOS
  • Android
  • Web

Request or proposed solution

Would you be willing to do this? We've discussed this before. For example here and here.

The current approach taken by Capacitor is quite different than the native approach and to me it seems inferior. I've outlined the differences here.

The main reason you took this approach, was

For us, the issue isn’t spec compliance — it’s whether this is reliable enough to serve as a runtime contract across OEMs, OS versions, etc.

However, as far as I can see, it seems, the current approach achieves quite the opposite. There were a few bugs that needed to be fixed (while it already was marked as production-ready) and there are still other open bugs (ex. 1, ex. 2).

What's also bothering me, is that the code has a few quirks.

  • The code doesn't bother for Android versions prior v15, which makes older Android versions just break without a developer directly noticing (source)
    • This seems to contradict the reason why you chose to go this route btw
  • When installing Capacitor v8 fresh, a developer would never know (without reading the docs thoroughly) that his app is broking on Chromium versions < M140 (source)

There are a few other code changes, which I do not quite understand (ex. 1, ex. 2, ex. 3)

Meanwhile, the https://github.com/capacitor-community/safe-area seems to work without any problems on a few enterprise-sized production apps. With one of its advantages being that it doesn't need any configuration changes when integrated in the Capacitor core.

I, myself, do not see any reason to not switch strategies. But if you're not up for it, you can close this issue and I will stop pursuing this going forward. Instead I will then just keep maintaining the community plugin

Alternatives

No response

Additional Information

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions