Ver código fonte

Playground : Fix an iPhone menu bug.

Jaskar 5 anos atrás
pai
commit
4a866bcabb
2 arquivos alterados com 7 adições e 2 exclusões
  1. 0 2
      Playground/css/index_mobile.css
  2. 7 0
      Playground/js/menuPG.js

+ 0 - 2
Playground/css/index_mobile.css

@@ -135,8 +135,6 @@
         min-height: 100px;
         max-height: calc(100% - 40px);
         text-align: left;
-        overflow-y: auto;
-        overflow-x: hidden;
     }
     .navbar .select .toDisplay.languageJS .option {
         background-color: #3f3461;

+ 7 - 0
Playground/js/menuPG.js

@@ -203,6 +203,13 @@ class MenuPG {
                 this.removeAllOptions();
                 toDisplay.style.display = 'block';
             }
+            
+            // Avoid an iPhone bug making the subitems disappear.
+            // Was previously done with "overflow-y : auto"
+            if(toDisplay.clientHeight < toDisplay.scrollHeight)
+                toDisplay.style.overflowY = "auto";
+            else
+                toDisplay.style.overflowY = "visible";
         }
         toDisplay = evt.target.parentNode.querySelector('.toDisplayBig');
         if (toDisplay) {