Skip to content

Commit

Permalink
enhance(events): Keyboard improvements for lower chrome versions #200
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-rr committed May 9, 2023
1 parent 3d9845a commit f23568b
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 52 deletions.
6 changes: 3 additions & 3 deletions dist/core/index.js

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions dist/cupertino-pane.esm.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* Cupertino Pane 1.3.13
* Cupertino Pane 1.3.2
* New generation interfaces for web3 progressive applications
* https://github.com/roman-rr/cupertino-pane/
*
* Copyright 2019-2023 Roman Antonov (roman-rr)
*
* Released under the MIT License
*
* Released on: February 2, 2023
* Released on: May 9, 2023
*/

/******************************************************************************
Expand Down Expand Up @@ -592,10 +592,6 @@ class Events {
if (!this.isOnViewport()) {
return;
}
if (this.device.android
&& !this.device.cordova) {
this.fixAndroidResize(true);
}
this.keyboardVisible = true;
// calculate distances
const currentHeight = this.settings.breaks[this.breakpoints.prevBreakpoint].height;
Expand Down Expand Up @@ -633,8 +629,7 @@ class Events {
if (!this.isOnViewport()) {
return;
}
if (this.device.android
&& !this.device.cordova) {
if (this.device.android) {
this.fixAndroidResize(false);
}
this.keyboardVisible = false;
Expand All @@ -660,6 +655,10 @@ class Events {
return __awaiter(this, void 0, void 0, function* () {
// We should separate keyboard and resize events
if (this.isKeyboardEvent()) {
// Android resize fixes
if (this.device.android) {
this.fixAndroidResize(true);
}
// Cordova & PWA iOS
if (this.device.cordova
|| this.device.ios) {
Expand Down Expand Up @@ -768,10 +767,12 @@ class Events {
window.requestAnimationFrame(() => {
if (showKeyboard) {
document.documentElement.style.setProperty('overflow', 'hidden');
metaViewport.setAttribute('content', 'height=' + this.instance.screen_height + 'px, width=device-width, initial-scale=1.0');
document.body.style.setProperty('min-height', `${this.instance.screen_height}px`);
metaViewport.setAttribute('content', 'height=' + this.instance.screen_height + ', width=device-width, initial-scale=1.0');
}
else {
document.documentElement.style.setProperty('overflow', 'hidden');
document.documentElement.style.removeProperty('overflow');
document.body.style.removeProperty('min-height');
metaViewport.setAttribute('content', 'viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no');
}
});
Expand Down
6 changes: 3 additions & 3 deletions dist/cupertino-pane.esm.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cupertino-pane.esm.min.js.map

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions dist/cupertino-pane.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cupertino-pane.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/cupertino-pane.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/modules/backdrop.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/modules/fit-height.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f23568b

Please sign in to comment.