Skip to content

Commit

Permalink
fix: correctly account for custom vertical padding with the VK
Browse files Browse the repository at this point in the history
  • Loading branch information
arnog committed Jul 26, 2023
1 parent 06705cf commit 3002aa8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions css/virtual-keyboard.less
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
body > .ML__keyboard {
position: fixed;
--_padding-bottom: calc(
var(--_padding-bottom) + env(safe-area-inset-bottom, 0)
var(--keyboard-padding-bottom, 0px) + env(safe-area-inset-bottom, 0)
);
}

Expand Down Expand Up @@ -270,7 +270,7 @@ body > .ML__keyboard.is-visible.animate > .MLK__backdrop {
// It contains all the operable UI (toolbar, rows of keycaps)
.MLK__plate {
position: absolute;
top: 0;
top: var(--_padding-top);
left: var(--_padding-horizontal);
width: calc(100% - 2 * var(--_padding-horizontal));
margin: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/virtual-keyboard/virtual-keyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ export class VirtualKeyboard implements VirtualKeyboardInterface, EventTarget {
if (this.container === document.body) {
this._element?.style.setProperty(
'--_keyboard-height',
`calc(${h}px + env(safe-area-inset-bottom, 0))`
`calc(${h}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`
);
const keyboardHeight = h - 1;
this.container!.style.paddingBottom = this.originalContainerBottomPadding
Expand Down

0 comments on commit 3002aa8

Please sign in to comment.