ionic-team / ionic-team/capacitor-keyboard

feat(keyboard): Add option to enable system scrolling

Open
#17 3 comments 6 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3
Forks
21
PR merge metrics
No merged PRs in 30d

Description

## 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:

```objc
[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.

Contributor guide

Open the contributing guide

Research direction

Start with the keyboard plugin's existing resizing-mode option and the iOS keyboard notification observer handling described in the issue. Trace how plugin options are changed at runtime and how IonInput auto-scrolling is controlled. Done means a runtime-changeable system-autoscroll option can remove or restore the listed WebView observers for iOS.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.