# patch-ios12-webview-keyboard

> patch for iOS 12 key board bug

Latest version **1.0.5** (published 2019-09-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install patch-ios12-webview-keyboard
pnpm add patch-ios12-webview-keyboard
yarn add patch-ios12-webview-keyboard
bun add patch-ios12-webview-keyboard
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2019-09-08 |
| First published | 2019-09-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | michael.00767@gmail.com |
| Maintainers | caige |

## Links

- npm: https://www.npmjs.com/package/patch-ios12-webview-keyboard
- Repository: https://github.com/MichaelIT/patch-ios12-webview-keyboard
- Homepage: https://github.com/MichaelIT/patch-ios12-webview-keyboard#readme
- Issues: https://github.com/MichaelIT/patch-ios12-webview-keyboard/issues
- npm.io page: https://npm.io/package/patch-ios12-webview-keyboard

## Recent versions

- 1.0.5 (latest) — 2019-09-08

## README

# patch for iOS 12 key board bug

## Detail

https://github.com/WebKit/webkit/commit/ec5ad1bd1bae03e0f85e4415e018ea5d09e046c1

```
2019-09-06  Darryl Pogue  <darryl@dpogue.ca>

        REGRESSION(iOS 12): Keyboard dismissal leaves WKWebView viewport-fit=cover content offscreen
        https://bugs.webkit.org/show_bug.cgi?id=192564

        Reviewed by Tim Horton.

        The new keyboard height was being read into a variable after the scrollview had already been
        adjusted. This worked when the keyboard was opening, because the scrollview is adjusted with
        the correct value a second time when the keyboard animation has finished. However, when the
        keyboard is closed, the adjustment was being made before the correct height was stored,
        leading to the scrollview being positioned as if the keyboard were still open.

        * UIProcess/ios/WKScrollView.mm:
        (-[WKScrollView _adjustForAutomaticKeyboardInfo:animated:lastAdjustment:]):
```

Before:

![before](./doc/before.gif)

After add this patch:

![before](./doc/after.gif)




## Build

```
npm install 
npm run build
```

## Usage

```
npm add fix-ios-12-keyboard-bug --save
import 'fix-ios-12-keyboard-bug';
```

or just copy `node_modules\@hz\fix-ios-12-keyboard-bug\dist\fix-ios-12-keyboard-bug.min.js` and add to your html file.

```
<script src='{{resDomain}}js/fix-ios-12-keyboard-bug.min.js'></script>
```

---
_Source: https://npm.io/package/patch-ios12-webview-keyboard · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
