1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05:00

Added type="button" to <button>s without any type (#23866)

https://github.com/twbs/bootlint/wiki/W007
This commit is contained in:
Herst 2017-10-03 03:59:37 +02:00 committed by Mark Otto
parent 0c03b70bcb
commit aae11ab6ab
4 changed files with 13 additions and 13 deletions

View 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. Badges can be used as part of links or buttons to provide a counter.
{% example html %} {% example html %}
<button class="btn btn-primary"> <button type="button" class="btn btn-primary">
Notifications <span class="badge badge-light">4</span> Notifications <span class="badge badge-light">4</span>
</button> </button>
{% endexample %} {% 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. 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 %} {% example html %}
<button class="btn btn-primary"> <button type="button" class="btn btn-primary">
Profile <span class="badge badge-light">9</span> Profile <span class="badge badge-light">9</span>
<span class="sr-only">unread messages</span> <span class="sr-only">unread messages</span>
</button> </button>

View file

@ -422,7 +422,7 @@ Modals have two optional sizes, available via modifier classes to be placed on a
{% highlight html %} {% highlight html %}
<!-- Large modal --> <!-- 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 fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg"> <div class="modal-dialog modal-lg">

View file

@ -18,19 +18,19 @@
<body> <body>
<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 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 type="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 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"> <div class="container-viewport">
<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-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-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> </div>

View file

@ -32,7 +32,7 @@ The following example shows how the clearfix can be used. Without the clearfix t
{% example html %} {% example html %}
<div class="bg-info clearfix"> <div class="bg-info clearfix">
<button class="btn btn-secondary float-left">Example Button floated left</button> <button type="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-right">Example Button floated right</button>
</div> </div>
{% endexample %} {% endexample %}