capacitor-plugins icon indicating copy to clipboard operation
capacitor-plugins copied to clipboard

feat(keyboard): Add option to enable system scrolling

Open vojto opened this issue 2 years ago • 3 comments

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 avatar Feb 16 '23 10:02 vojto