]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Added type="button" to <button>s without any type (#23866)
authorHerst <Herst@users.noreply.github.com>
Tue, 3 Oct 2017 01:59:37 +0000 (03:59 +0200)
committerMark Otto <markd.otto@gmail.com>
Tue, 3 Oct 2017 01:59:37 +0000 (18:59 -0700)
https://github.com/twbs/bootlint/wiki/W007

docs/4.0/components/badge.md
docs/4.0/components/modal.md
docs/4.0/examples/tooltip-viewport/index.html
docs/4.0/utilities/clearfix.md

index 3ea58bbe8e45c7c301562d6b065c7ebcc1ef5c54..c42d948d67966848e665742bd3d581c6a9aab7d7 100644 (file)
@@ -31,7 +31,7 @@ Badges scale to match the size of the immediate parent element by using relative
 Badges can be used as part of links or buttons to provide a counter.
 
 {% example html %}
-<button class="btn btn-primary">
+<button type="button" class="btn btn-primary">
   Notifications <span class="badge badge-light">4</span>
 </button>
 {% endexample %}
@@ -41,7 +41,7 @@ Note that depending on how they are used, badges may be confusing for users of s
 Unless the context is clear (as with the "Notifications" example, where it is understood that the "4" is the number of notifications), consider including additional context with a visually hidden piece of additional text.
 
 {% example html %}
-<button class="btn btn-primary">
+<button type="button" class="btn btn-primary">
   Profile <span class="badge badge-light">9</span>
   <span class="sr-only">unread messages</span>
 </button>
index 55c1dbc314ed2b037ead7e367babe82fb3258660..491bd3fb8f7a8cc0a5ed2105874e3eed53aed605 100644 (file)
@@ -422,7 +422,7 @@ Modals have two optional sizes, available via modifier classes to be placed on a
 
 {% highlight html %}
 <!-- Large modal -->
-<button class="btn btn-primary" data-toggle="modal" data-target=".bd-example-modal-lg">Large modal</button>
+<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bd-example-modal-lg">Large modal</button>
 
 <div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
   <div class="modal-dialog modal-lg">
index a74317911b43b3ea0524f138af74d6c4089e2846..88e555036c0afc528581e584e2d0911acd57074b 100644 (file)
 
   <body>
 
-    <button class="btn btn-secondary float-right tooltip-bottom" title="This should be shifted to the left">Shift Left</button>
-    <button class="btn btn-secondary tooltip-bottom" title="This should be shifted to the right">Shift Right</button>
-    <button class="btn btn-secondary tooltip-right" title="This should be shifted down">Shift Down</button>
+    <button type="button" class="btn btn-secondary float-right tooltip-bottom" title="This should be shifted to the left">Shift Left</button>
+    <button type="button" class="btn btn-secondary tooltip-bottom" title="This should be shifted to the right">Shift Right</button>
+    <button type="button" class="btn btn-secondary tooltip-right" title="This should be shifted down">Shift Down</button>
 
-    <button class="btn btn-secondary tooltip-right btn-bottom" title="This should be shifted up">Shift Up</button>
+    <button type="button" class="btn btn-secondary tooltip-right btn-bottom" title="This should be shifted up">Shift Up</button>
 
     <div class="container-viewport">
-      <button class="btn btn-secondary tooltip-viewport-bottom" title="This should be shifted to the left">Shift Left</button>
-      <button class="btn btn-secondary tooltip-viewport-right" title="This should be shifted down">Shift Down</button>
+      <button type="button" class="btn btn-secondary tooltip-viewport-bottom" title="This should be shifted to the left">Shift Left</button>
+      <button type="button" class="btn btn-secondary tooltip-viewport-right" title="This should be shifted down">Shift Down</button>
 
-      <button class="btn btn-secondary float-right tooltip-viewport-bottom" title="This should be shifted to the right">Shift Right</button>
+      <button type="button" class="btn btn-secondary float-right tooltip-viewport-bottom" title="This should be shifted to the right">Shift Right</button>
 
-      <button class="btn btn-secondary tooltip-viewport-right btn-bottom" title="This should be shifted up">Shift Up</button>
+      <button type="button" class="btn btn-secondary tooltip-viewport-right btn-bottom" title="This should be shifted up">Shift Up</button>
     </div>
 
 
index d9de7fdf4704cbe8d47b44f89f487233ef7d8e86..535a3359329d3a456a0e352d99db978adaa0a2a1 100644 (file)
@@ -32,7 +32,7 @@ The following example shows how the clearfix can be used. Without the clearfix t
 
 {% example html %}
 <div class="bg-info clearfix">
-  <button class="btn btn-secondary float-left">Example Button floated left</button>
-  <button class="btn btn-secondary float-right">Example Button floated right</button>
+  <button type="button" class="btn btn-secondary float-left">Example Button floated left</button>
+  <button type="button" class="btn btn-secondary float-right">Example Button floated right</button>
 </div>
 {% endexample %}