Skip to content

A platform for community discussion. Free, open, simple.

FIX: Modals on Android when keyboard is visible (#24442)

Penar Musaraj36606a215742
diff --git a/app/assets/stylesheets/mobile/_index.scss b/app/assets/stylesheets/mobile/_index.scss
index 94d87add0c7..6f251403a0a 100644
--- a/app/assets/stylesheets/mobile/_index.scss
+++ b/app/assets/stylesheets/mobile/_index.scss
@@ -8,6 +8,7 @@
@import "buttons";
@import "compose";
@import "dashboard";
+@import "dialog";
@import "directory";
@import "discourse";
@import "edit-category";
diff --git a/app/assets/stylesheets/mobile/dialog.scss b/app/assets/stylesheets/mobile/dialog.scss
new file mode 100644
index 00000000000..c99fd609767
--- /dev/null
+++ b/app/assets/stylesheets/mobile/dialog.scss
@@ -0,0 +1,6 @@
+.dialog-container {
+ // fixes modal placement on Android when keyboard is visible
+ html.keyboard-visible:not(.ios-device) & {
+ height: calc(100% - env(keyboard-inset-height));
+ }
+}
diff --git a/app/assets/stylesheets/mobile/modal.scss b/app/assets/stylesheets/mobile/modal.scss
index a719e5b67ff..3e901d58aa7 100644
--- a/app/assets/stylesheets/mobile/modal.scss
+++ b/app/assets/stylesheets/mobile/modal.scss
@@ -5,6 +5,15 @@
width: 100%;
max-width: 100%;
}
+
+ // fixes modal placement on Android when keyboard is visible
+ html.keyboard-visible:not(.ios-device) & {
+ height: calc(100% - env(keyboard-inset-height));
+
+ .d-modal__container {
+ max-height: 100%;
+ }
+ }
}
//legacy