ionic-team / capacitor-plugins

Official plugins for Capacitor ⚡️
514 stars 581 forks source link

feat(keyboard): Add option to enable system scrolling #1421

Open vojto opened 1 year ago

vojto commented 1 year ago

Feature Request

Plugin

keyboard

Description

Before the keyboard plugin is added, Capacitor uses system scrolling that looks like this. After the plugin is added, it's not possible to restore this behavior.

https://user-images.githubusercontent.com/50943/219069658-c07f6330-1fc2-499f-8753-f4c36ea50887.mp4

We would like to be able to programmatically opt into this original functionality for certain screens, and opt out of IonInput auto-scrolling.

This would be used for screens that don't use a header.

Platform(s)

iOS

Preferred Solution

In addition to "resizing mode" option, add another option called "system autoscroll". It should be programmatically change-able during runtime.

Changing its value would either remove or restore WebView as observer to keyboard showing/hiding notifications:

[nc removeObserver:self.webView name:UIKeyboardWillHideNotification object:nil];
[nc removeObserver:self.webView name:UIKeyboardWillShowNotification object:nil];
[nc removeObserver:self.webView name:UIKeyboardWillChangeFrameNotification object:nil];
[nc removeObserver:self.webView name:UIKeyboardDidChangeFrameNotification object:nil];

Alternatives

Another alternative is to wait for IonInput scrolling to be improved (see https://github.com/ionic-team/ionic-framework/issues/26803). However, for these simple screens, it would be simler to just opt into system scrolling.

vojto commented 1 year ago

Hey team, what do you think about this feature request? I'd be happy to submit a PR if you agree with the idea.

Thanks!

wnvuong commented 11 months ago

I'm also interested in getting this resolved, we would like to be able to turn off the accessory bar but maintain this input scroll into view functionality.

BECInc commented 2 months ago

This is definitely needed. Having to recreate this functionality manually on iOS is a non-starter for using the plugin