]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Issue 10416 - input-group buttons not sized properly
authorGerry Kaplan <gkaplan@kaplansoftware.com>
Sun, 23 Jul 2017 15:16:22 +0000 (11:16 -0400)
committerGerry Kaplan <gkaplan@kaplansoftware.com>
Sun, 23 Jul 2017 15:16:22 +0000 (11:16 -0400)
Adjusted height for flex mode to fill parent container. Added two tests
- one for flex/xygrid and the other for flow mode.

scss/forms/_input-group.scss
test/visual/form/input-group-flow.html [new file with mode: 0644]
test/visual/form/input-group-xygrid.html [new file with mode: 0644]

index 887ff326719e8208ce2f110e8e2cb5087f53f32b..7a9338fbe6d40f91fe0c3171496ec0ece02c4f6d 100644 (file)
@@ -107,6 +107,7 @@ $input-prefix-padding: 1rem !default;
 
     @if $global-flexbox {
       flex: 0 0 auto;
+      display: flex;
     }
     @else {
       width: 1%;
@@ -118,10 +119,16 @@ $input-prefix-padding: 1rem !default;
     button,
     label {
       @extend %input-group-child;
-      height: $height;
+
+      @if $global-flexbox {
+        height: auto;
+        align-self: stretch;
+      }
+      @else {
+        height: $height;
+      }
       padding-top: 0;
       padding-bottom: 0;
-
       font-size: $input-font-size;
     }
   }
diff --git a/test/visual/form/input-group-flow.html b/test/visual/form/input-group-flow.html
new file mode 100644 (file)
index 0000000..883c467
--- /dev/null
@@ -0,0 +1,35 @@
+<!doctype html>
+<!--[if IE 9]><html class="lt-ie10" lang="en" > <![endif]-->
+<html class="no-js" lang="en" dir="ltr">
+  <head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
+    <title>Foundation for Sites Testing</title>
+    <link href="../motion-ui/dist/motion-ui.css" rel="stylesheet" />
+    <link href="../assets/css/foundation-float.css" rel="stylesheet" />
+  </head>
+  <body>
+
+    <div class="row column">
+      <h3>FLOW Control Group: input-group height &amp; vertical alignment.</h3>
+      <p>Assure that all controls are flush at the top and bottom. Pay special
+        attention to the Submit button.</p>
+    </div>
+    <div class="medium-4 column">
+      <div class="input-group">
+        <span class="input-group-label">$</span>
+        <input class="input-group-field" type="number">
+        <div class="input-group-button">
+          <input type="submit" class="button" value="Submit">
+        </div>
+      </div>
+    </div>
+
+    <script src="../assets/js/vendor.js"></script>
+    <script src="../assets/js/foundation.js"></script>
+    <script>
+      $(document).foundation();
+    </script>
+  </body>
+</html>
diff --git a/test/visual/form/input-group-xygrid.html b/test/visual/form/input-group-xygrid.html
new file mode 100644 (file)
index 0000000..7242f3f
--- /dev/null
@@ -0,0 +1,40 @@
+<!doctype html>
+<!--[if IE 9]><html class="lt-ie10" lang="en" > <![endif]-->
+<html class="no-js" lang="en" dir="ltr">
+  <head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
+    <title>Foundation for Sites Testing</title>
+    <link href="../motion-ui/dist/motion-ui.css" rel="stylesheet" />
+    <link href="../assets/css/foundation.css" rel="stylesheet" />
+
+  </head>
+  <body>
+
+    <div class="grid-container">
+      <div class="grid-x grid-padding-x">
+        <div class="medium-12 cell">
+          <h3>XY Grid-Control Group: input-group height &amp; vertical alignment.</h3>
+          <p>Assure that all controls are flush at the top and bottom. Pay special
+            attention to the Submit button.</p>
+        </div>
+        <div class="medium-4 cell">
+          <div class="input-group">
+            <span class="input-group-label">$</span>
+            <input class="input-group-field" type="number">
+            <div class="input-group-button">
+              <input type="submit" class="button" value="Submit">
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <script src="../assets/js/vendor.js"></script>
+    <script src="../assets/js/foundation.js"></script>
+    <script>
+      $(document).foundation();
+    </script>
+  </body>
+</html>