aboutsummaryrefslogtreecommitdiff
path: root/docs/4.0/components
diff options
context:
space:
mode:
authorSharrell Porter <[email protected]>2017-10-20 07:12:39 -0400
committerSharrell Porter <[email protected]>2017-10-20 07:12:39 -0400
commit4f814fabd6aa198df72e8263350fa60213d13176 (patch)
tree8fbcc6b66212a39be6bb8b1a6811a4f3eb2e901a /docs/4.0/components
parent77ea66da4dc054b33392d32be152eb1082d305e2 (diff)
parent9a1d81f154f4391f9fea47fc26cd2fa864d6ae8a (diff)
downloadbootstrap-4f814fabd6aa198df72e8263350fa60213d13176.tar.xz
bootstrap-4f814fabd6aa198df72e8263350fa60213d13176.zip
sync-commits erge branch 'v4-dev' into custom-checkboxes-radios-correct-color
Diffstat (limited to 'docs/4.0/components')
-rw-r--r--docs/4.0/components/alerts.md3
-rw-r--r--docs/4.0/components/badge.md2
-rw-r--r--docs/4.0/components/buttons.md3
-rw-r--r--docs/4.0/components/card.md13
-rw-r--r--docs/4.0/components/carousel.md6
-rw-r--r--docs/4.0/components/collapse.md4
-rw-r--r--docs/4.0/components/dropdowns.md3
-rw-r--r--docs/4.0/components/forms.md133
-rw-r--r--docs/4.0/components/modal.md8
-rw-r--r--docs/4.0/components/navbar.md22
-rw-r--r--docs/4.0/components/navs.md6
-rw-r--r--docs/4.0/components/popovers.md8
-rw-r--r--docs/4.0/components/scrollspy.md7
-rw-r--r--docs/4.0/components/tooltips.md2
14 files changed, 148 insertions, 72 deletions
diff --git a/docs/4.0/components/alerts.md b/docs/4.0/components/alerts.md
index b8bb0c216..aa6dfbecc 100644
--- a/docs/4.0/components/alerts.md
+++ b/docs/4.0/components/alerts.md
@@ -50,7 +50,7 @@ Alerts can also contain additional HTML elements like headings, paragraphs and d
Using the alert JavaScript plugin, it's possible to dismiss any alert inline. Here's how:
- Be sure you've loaded the alert plugin, or the compiled Bootstrap JavaScript.
-- If you're building our JS from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util). The compiled version includes this.
+- If you're building our JavaScript from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util). The compiled version includes this.
- Add a dismiss button and the `.alert-dismissible` class, which adds extra padding to the right of the alert and positions the `.close` button.
- On the dismiss button, add the `data-dismiss="alert"` attribute, which triggers the JavaScript functionality. Be sure to use the `<button>` element with it for proper behavior across all devices.
- To animate alerts when dismissing them, be sure to add the `.fade` and `.show` classes.
@@ -92,6 +92,7 @@ Note that closing an alert will remove it from the DOM.
| --- | --- |
| `$().alert()` | Makes an alert listen for click events on descendant elements which have the `data-dismiss="alert"` attribute. (Not necessary when using the data-api's auto-initialization.) |
| `$().alert('close')` | Closes an alert by removing it from the DOM. If the `.fade` and `.show` classes are present on the element, the alert will fade out before it is removed. |
+| `$().alert('dispose')` | Destroys an element's alert. |
{% highlight js %}$(".alert").alert('close'){% endhighlight %}
diff --git a/docs/4.0/components/badge.md b/docs/4.0/components/badge.md
index c42d948d6..287005e7d 100644
--- a/docs/4.0/components/badge.md
+++ b/docs/4.0/components/badge.md
@@ -70,7 +70,7 @@ Use the `.badge-pill` modifier class to make badges more rounded (with a larger
## Links
-Using the `.badge` classes with the `<a>` element quickly provide _actionable_ badges with hover and focus states.
+Using the contextual `.badge-*` classes on an `<a>` element quickly provide _actionable_ badges with hover and focus states.
{% example html %}
{% for color in site.data.theme-colors %}
diff --git a/docs/4.0/components/buttons.md b/docs/4.0/components/buttons.md
index fac603e7e..41ca9cef0 100644
--- a/docs/4.0/components/buttons.md
+++ b/docs/4.0/components/buttons.md
@@ -154,4 +154,5 @@ Note that pre-checked buttons require you to manually add the `.active` class to
| Method | Description |
| --- | --- |
-| `$().button('toggle')` |Toggles push state. Gives the button the appearance that it has been activated. |
+| `$().button('toggle')` | Toggles push state. Gives the button the appearance that it has been activated. |
+| `$().button('dispose')` | Destroys an element's button. |
diff --git a/docs/4.0/components/card.md b/docs/4.0/components/card.md
index 5da0ef039..76f4757ec 100644
--- a/docs/4.0/components/card.md
+++ b/docs/4.0/components/card.md
@@ -90,6 +90,19 @@ Create lists of content in a card with a flush list group.
</div>
{% endexample %}
+{% example html %}
+<div class="card" style="width: 20rem;">
+ <div class="card-header">
+ Featured
+ </div>
+ <ul class="list-group list-group-flush">
+ <li class="list-group-item">Cras justo odio</li>
+ <li class="list-group-item">Dapibus ac facilisis in</li>
+ <li class="list-group-item">Vestibulum at eros</li>
+ </ul>
+</div>
+{% endexample %}
+
### Kitchen sink
Mix and match multiple content types to create the card you need, or throw everything in there. Shown below are image styles, blocks, text styles, and a list group—all wrapped in a fixed-width card.
diff --git a/docs/4.0/components/carousel.md b/docs/4.0/components/carousel.md
index 4919e1ac2..af2648267 100644
--- a/docs/4.0/components/carousel.md
+++ b/docs/4.0/components/carousel.md
@@ -14,7 +14,7 @@ In browsers where the [Page Visibility API](https://www.w3.org/TR/page-visibilit
Please be aware that nested carousels are not supported, and carousels are generally not compliant with accessibility standards.
-Lastly, if you're building our JS from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
+Lastly, if you're building our JavaScript from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
## Example
@@ -263,6 +263,10 @@ Cycles to the previous item. **Returns to the caller before the previous item ha
Cycles to the next item. **Returns to the caller before the next item has been shown** (i.e. before the `slid.bs.carousel` event occurs).
+### `.carousel('dispose')`
+
+Destroys an element's carousel.
+
### Events
Bootstrap's carousel class exposes two events for hooking into carousel functionality. Both events have the following additional properties:
diff --git a/docs/4.0/components/collapse.md b/docs/4.0/components/collapse.md
index a34ffeb7b..cd0a7d4e5 100644
--- a/docs/4.0/components/collapse.md
+++ b/docs/4.0/components/collapse.md
@@ -226,6 +226,10 @@ Shows a collapsible element. **Returns to the caller before the collapsible elem
Hides a collapsible element. **Returns to the caller before the collapsible element has actually been hidden** (i.e. before the `hidden.bs.collapse` event occurs).
+### `.collapse('dispose')`
+
+Destroys an element's collapse.
+
### Events
Bootstrap's collapse class exposes a few events for hooking into collapse functionality.
diff --git a/docs/4.0/components/dropdowns.md b/docs/4.0/components/dropdowns.md
index d38b410c7..f91ff5312 100644
--- a/docs/4.0/components/dropdowns.md
+++ b/docs/4.0/components/dropdowns.md
@@ -12,7 +12,7 @@ Dropdowns are toggleable, contextual overlays for displaying lists of links and
Dropdowns are built on a third party library, [Popper.js](https://popper.js.org/), which provides dynamic positioning and viewport detection. Be sure to include [popper.min.js]({{ site.cdn.popper }}) before Bootstrap's JavaScript or use `bootstrap.bundle.min.js` / `bootstrap.bundle.js` which contains Popper.js.
-If you're building our JS from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
+If you're building our JavaScript from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
## Accessibility
@@ -607,6 +607,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
| --- | --- |
| `$().dropdown('toggle')` | Toggles the dropdown menu of a given navbar or tabbed navigation. |
| `$().dropdown('update')` | Updates the position of an element's dropdown. |
+| `$().dropdown('dispose')` | Destroys an element's dropdown. |
### Events
diff --git a/docs/4.0/components/forms.md b/docs/4.0/components/forms.md
index ed4d95b70..abf6c1e67 100644
--- a/docs/4.0/components/forms.md
+++ b/docs/4.0/components/forms.md
@@ -264,11 +264,11 @@ The `.form-group` class is the easiest way to add some structure to forms. Its o
{% example html %}
<form>
<div class="form-group">
- <label class="form-control-label" for="formGroupExampleInput">Example label</label>
+ <label class="col-form-label" for="formGroupExampleInput">Example label</label>
<input type="text" class="form-control" id="formGroupExampleInput" placeholder="Example input">
</div>
<div class="form-group">
- <label class="form-control-label" for="formGroupExampleInput2">Another label</label>
+ <label class="col-form-label" for="formGroupExampleInput2">Another label</label>
<input type="text" class="form-control" id="formGroupExampleInput2" placeholder="Another input">
</div>
</form>
@@ -314,36 +314,36 @@ More complex layouts can also be created with the grid system.
<form>
<div class="form-row">
<div class="form-group col-md-6">
- <label for="inputEmail4" class="col-form-label">Email</label>
+ <label for="inputEmail4">Email</label>
<input type="email" class="form-control" id="inputEmail4" placeholder="Email">
</div>
<div class="form-group col-md-6">
- <label for="inputPassword4" class="col-form-label">Password</label>
+ <label for="inputPassword4">Password</label>
<input type="password" class="form-control" id="inputPassword4" placeholder="Password">
</div>
</div>
<div class="form-group">
- <label for="inputAddress" class="col-form-label">Address</label>
+ <label for="inputAddress">Address</label>
<input type="text" class="form-control" id="inputAddress" placeholder="1234 Main St">
</div>
<div class="form-group">
- <label for="inputAddress2" class="col-form-label">Address 2</label>
+ <label for="inputAddress2">Address 2</label>
<input type="text" class="form-control" id="inputAddress2" placeholder="Apartment, studio, or floor">
</div>
<div class="form-row">
<div class="form-group col-md-6">
- <label for="inputCity" class="col-form-label">City</label>
+ <label for="inputCity">City</label>
<input type="text" class="form-control" id="inputCity">
</div>
<div class="form-group col-md-4">
- <label for="inputState" class="col-form-label">State</label>
+ <label for="inputState">State</label>
<select id="inputState" class="form-control">
<option selected>Choose...</option>
<option>...</option>
</select>
</div>
<div class="form-group col-md-2">
- <label for="inputZip" class="col-form-label">Zip</label>
+ <label for="inputZip">Zip</label>
<input type="text" class="form-control" id="inputZip">
</div>
</div>
@@ -365,62 +365,87 @@ Create horizontal forms with the grid by adding the `.row` class to form groups
Be sure to add `.col-form-label` to your `<label>`s as well so they're vertically centered with their associated form controls. For `<legend>` elements, you can use `.col-form-legend` to make them appear similar to regular `<label>` elements.
{% example html %}
-<div class="container">
- <form>
- <div class="form-group row">
- <label for="inputEmail3" class="col-sm-2 col-form-label">Email</label>
- <div class="col-sm-10">
- <input type="email" class="form-control" id="inputEmail3" placeholder="Email">
- </div>
+<form>
+ <div class="form-group row">
+ <label for="inputEmail3" class="col-sm-2 col-form-label">Email</label>
+ <div class="col-sm-10">
+ <input type="email" class="form-control" id="inputEmail3" placeholder="Email">
</div>
- <div class="form-group row">
- <label for="inputPassword3" class="col-sm-2 col-form-label">Password</label>
- <div class="col-sm-10">
- <input type="password" class="form-control" id="inputPassword3" placeholder="Password">
- </div>
+ </div>
+ <div class="form-group row">
+ <label for="inputPassword3" class="col-sm-2 col-form-label">Password</label>
+ <div class="col-sm-10">
+ <input type="password" class="form-control" id="inputPassword3" placeholder="Password">
</div>
- <fieldset class="form-group">
- <div class="row">
- <legend class="col-form-legend col-sm-2">Radios</legend>
- <div class="col-sm-10">
- <div class="form-check">
- <label class="form-check-label">
- <input class="form-check-input" type="radio" name="gridRadios" id="gridRadios1" value="option1" checked>
- Option one is this and that&mdash;be sure to include why it's great
- </label>
- </div>
- <div class="form-check">
- <label class="form-check-label">
- <input class="form-check-input" type="radio" name="gridRadios" id="gridRadios2" value="option2">
- Option two can be something else and selecting it will deselect option one
- </label>
- </div>
- <div class="form-check disabled">
- <label class="form-check-label">
- <input class="form-check-input" type="radio" name="gridRadios" id="gridRadios3" value="option3" disabled>
- Option three is disabled
- </label>
- </div>
- </div>
- </div>
- </fieldset>
- <div class="form-group row">
- <div class="col-sm-2">Checkbox</div>
+ </div>
+ <fieldset class="form-group">
+ <div class="row">
+ <legend class="col-form-legend col-sm-2">Radios</legend>
<div class="col-sm-10">
<div class="form-check">
<label class="form-check-label">
- <input class="form-check-input" type="checkbox"> Check me out
+ <input class="form-check-input" type="radio" name="gridRadios" id="gridRadios1" value="option1" checked>
+ Option one is this and that&mdash;be sure to include why it's great
+ </label>
+ </div>
+ <div class="form-check">
+ <label class="form-check-label">
+ <input class="form-check-input" type="radio" name="gridRadios" id="gridRadios2" value="option2">
+ Option two can be something else and selecting it will deselect option one
+ </label>
+ </div>
+ <div class="form-check disabled">
+ <label class="form-check-label">
+ <input class="form-check-input" type="radio" name="gridRadios" id="gridRadios3" value="option3" disabled>
+ Option three is disabled
</label>
</div>
</div>
</div>
- <div class="form-group row">
- <div class="col-sm-10">
- <button type="submit" class="btn btn-primary">Sign in</button>
+ </fieldset>
+ <div class="form-group row">
+ <div class="col-sm-2">Checkbox</div>
+ <div class="col-sm-10">
+ <div class="form-check">
+ <label class="form-check-label">
+ <input class="form-check-input" type="checkbox"> Check me out
+ </label>
</div>
</div>
- </form>
-</div>
+ </div>
+ <div class="form-group row">
+ <div class="col-sm-10">
+ <button type="submit" class="btn btn-primary">Sign in</button>
+ </div>
+ </div>
+</form>
+{% endexample %}
+
+##### Horizontal form label sizing
+
+Be sure to use `.col-form-label-sm` or `.col-form-label-lg` to your `<label>`s to correctly follow the size of `.form-control-lg` and `.form-control-sm`.
+
+{% example html %}
+<form>
+ <div class="form-group row">
+ <label for="colFormLabelSm" class="col-sm-2 col-form-label col-form-label-sm">Email</label>
+ <div class="col-sm-10">
+ <input type="email" class="form-control form-control-sm" id="colFormLabelSm" placeholder="col-form-label-sm">
+ </div>
+ </div>
+ <div class="form-group row">
+ <label for="colFormLabel" class="col-sm-2 col-form-label">Email</label>
+ <div class="col-sm-10">
+ <input type="email" class="form-control" id="colFormLabel" placeholder="col-form-label">
+ </div>
+ </div>
+ <div class="form-group row">
+ <label for="colFormLabelLg" class="col-sm-2 col-form-label col-form-label-lg">Email</label>
+ <div class="col-sm-10">
+ <input type="email" class="form-control form-control-lg" id="colFormLabelLg" placeholder="col-form-label-lg">
+ </div>
+ </div>
+</form>
{% endexample %}
#### Column sizing
diff --git a/docs/4.0/components/modal.md b/docs/4.0/components/modal.md
index 491bd3fb8..c4191b83d 100644
--- a/docs/4.0/components/modal.md
+++ b/docs/4.0/components/modal.md
@@ -359,11 +359,11 @@ Below is a live demo followed by example HTML and JavaScript. For more informati
<div class="modal-body">
<form>
<div class="form-group">
- <label for="recipient-name" class="form-control-label">Recipient:</label>
+ <label for="recipient-name" class="col-form-label">Recipient:</label>
<input type="text" class="form-control" id="recipient-name">
</div>
<div class="form-group">
- <label for="message-text" class="form-control-label">Message:</label>
+ <label for="message-text" class="col-form-label">Message:</label>
<textarea class="form-control" id="message-text"></textarea>
</div>
</form>
@@ -575,6 +575,10 @@ Manually readjust the modal's position if the height of a modal changes while it
{% highlight js %}$('#myModal').modal('handleUpdate'){% endhighlight %}
+### `.modal('dispose')`
+
+Destroys an element's modal.
+
### Events
Bootstrap's modal class exposes a few events for hooking into modal functionality. All modal events are fired at the modal itself (i.e. at the `<div class="modal">`).
diff --git a/docs/4.0/components/navbar.md b/docs/4.0/components/navbar.md
index f303aa2bc..a40b68897 100644
--- a/docs/4.0/components/navbar.md
+++ b/docs/4.0/components/navbar.md
@@ -12,8 +12,9 @@ Here's what you need to know before getting started with the navbar:
- Navbars require a wrapping `.navbar` with `.navbar-expand{-sm|-md|-lg|-xl}` for responsive collapsing and [color scheme](#color-schemes) classes.
- Navbars and their contents are fluid by default. Use [optional containers](#containers) to limit their horizontal width.
-- Navbars and their contents are built with flexbox, providing easy alignment options via utility classes.
+- Use our [spacing]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/) and [flex]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/flex/) utility classes for controlling spacing and alignment within navbars.
- Navbars are responsive by default, but you can easily modify them to change that. Responsive behavior depends on our Collapse JavaScript plugin.
+- Navbars are hidden by default when printing. Force them to be printed by adding `.d-print` to the `.navbar`. See the [display]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/display/) utility class.
- Ensure accessibility by using a `<nav>` element or, if using a more generic element such as a `<div>`, add a `role="navigation"` to every navbar to explicitly identify it as a landmark region for users of assistive technologies.
Read on for an example and list of supported sub-components.
@@ -46,6 +47,17 @@ Here's an example of all the sub-components included in a responsive light-theme
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
+ <li class="nav-item dropdown">
+ <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ Dropdown
+ </a>
+ <div class="dropdown-menu" aria-labelledby="navbarDropdown">
+ <a class="dropdown-item" href="#">Action</a>
+ <a class="dropdown-item" href="#">Another action</a>
+ <div class="dropdown-divider"></div>
+ <a class="dropdown-item" href="#">Something else here</a>
+ </div>
+ </li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
@@ -58,6 +70,8 @@ Here's an example of all the sub-components included in a responsive light-theme
</nav>
{% endexample %}
+This example uses [color]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/colors/) (`bg-light`) and [spacing]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/) (`my-2`, `my-lg-0`, `mr-sm-0`, `my-sm-0`) utility classes.
+
### Brand
The `.navbar-brand` can be applied to most elements, but an anchor works best as some elements might require utility classes or custom styles.
@@ -395,11 +409,13 @@ When the container is within your navbar, its horizontal padding is removed at b
## Placement
-Use our position utilities to place navbars in non-static positions. Choose from fixed to the top, fixed to the bottom, or stickied to the top. **Note that `position: sticky`, used for `.sticky-top`, [isn't fully supported in every browser](https://caniuse.com/#feat=css-sticky).**
+Use our [position utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/position/) to place navbars in non-static positions. Choose from fixed to the top, fixed to the bottom, or stickied to the top (scrolls with the page until it reaches the top, then stays there). Fixed navbars use `position: fixed`, meaning they're pulled from the normal flow of the DOM and may require custom CSS (e.g., `padding-top` on the `<body>`) to prevent overlap with other elements.
+
+Also note that **`.sticky-top` uses `position: sticky`, which [isn't fully supported in every browser](https://caniuse.com/#feat=css-sticky)**.
{% example html %}
<nav class="navbar navbar-light bg-light">
- <a class="navbar-brand" href="#">Full width</a>
+ <a class="navbar-brand" href="#">Default</a>
</nav>
{% endexample %}
diff --git a/docs/4.0/components/navs.md b/docs/4.0/components/navs.md
index b34f79c2f..20e822353 100644
--- a/docs/4.0/components/navs.md
+++ b/docs/4.0/components/navs.md
@@ -297,7 +297,7 @@ Add dropdown menus with a little extra HTML and the [dropdowns JavaScript plugin
Use the tab JavaScript plugin—include it individually or through the compiled `bootstrap.js` file—to extend our navigational tabs and pills to create tabbable panes of local content, even via dropdown menus.
-If you're building our JS from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
+If you're building our JavaScript from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
Dynamic tabbed interfaces, as described in the [<abbr title="Web Accessibility Initiative">WAI</abbr> <abbr title="Accessible Rich Internet Applications">ARIA</abbr> Authoring Practices](https://www.w3.org/TR/wai-aria-practices/#tabpanel), require `role="tablist"`, `role="tab"`, `role="tabpanel"`, and additional `aria-` attributes in order to convey their structure, functionality and current state to users of assistive technologies (such as screen readers).
@@ -583,6 +583,10 @@ Selects the given tab and shows its associated pane. Any other tab that was prev
$('#someTab').tab('show')
{% endhighlight %}
+### .tab('dispose')
+
+Destroys an element's tab.
+
### Events
When showing a new tab, the events fire in the following order:
diff --git a/docs/4.0/components/popovers.md b/docs/4.0/components/popovers.md
index b8356b0d2..31ff5c61f 100644
--- a/docs/4.0/components/popovers.md
+++ b/docs/4.0/components/popovers.md
@@ -13,16 +13,16 @@ Things to know when using the popover plugin:
- Popovers rely on the 3rd party library [Popper.js](https://popper.js.org/) for positioning. You must include [popper.min.js]({{ site.cdn.popper }}) before bootstrap.js or use `bootstrap.bundle.min.js` / `bootstrap.bundle.js` which contains Popper.js in order for popovers to work!
- Popovers require the [tooltip plugin]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/tooltips/) as a dependency.
-- If building our JS from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
+- If you're building our JavaScript from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
- Popovers are opt-in for performance reasons, so **you must initialize them yourself**.
- Zero-length `title` and `content` values will never show a popover.
- Specify `container: 'body'` to avoid rendering problems in more complex components (like our input groups, button groups, etc).
- Triggering popovers on hidden elements will not work.
- Popovers for `.disabled` or `disabled` elements must be triggered on a wrapper element.
-- When triggered from hyperlinks that span multiple lines, popovers will be centered. Use `white-space: nowrap;` on your `<a>`s to avoid this behavior.
+- When triggered from anchors that wrap across multiple lines, popovers will be centered between the anchors' overall width. Use `white-space: nowrap;` on your `<a>`s to avoid this behavior.
- Popovers must be hidden before their corresponding elements have been removed from the DOM.
-Got all that? Great, let's see how they work with some examples.
+Keep reading to see how popovers work with some examples.
## Example: Enable popovers everywhere
@@ -132,7 +132,7 @@ sagittis lacus vel augue laoreet rutrum faucibus.">
### Dismiss on next click
-Use the `focus` trigger to dismiss popovers on the next click that the user makes.
+Use the `focus` trigger to dismiss popovers on the user's next click of a different element than the toggle element.
{% callout danger %}
#### Specific markup required for dismiss-on-next-click
diff --git a/docs/4.0/components/scrollspy.md b/docs/4.0/components/scrollspy.md
index b7f9e994f..ef528b0f0 100644
--- a/docs/4.0/components/scrollspy.md
+++ b/docs/4.0/components/scrollspy.md
@@ -10,8 +10,8 @@ toc: true
Scrollspy has a few requirements to function properly:
-- If building our JS from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
-- It must to be used on a Bootstrap [nav component]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/navs/) or [list group]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/list-group/).
+- If you're building our JavaScript from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
+- It must be used on a Bootstrap [nav component]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/navs/) or [list group]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/list-group/).
- Scrollspy requires `position: relative;` on the element you're spying on, usually the `<body>`.
- When spying on elements other than the `<body>`, be sure to have a `height` set and `overflow-y: scroll;` applied.
- Anchors (`<a>`) are required and must point to an element with that `id`.
@@ -280,6 +280,9 @@ $('[data-spy="scroll"]').each(function () {
})
{% endhighlight %}
+### `.scrollspy('dispose')`
+
+Destroys an element's scrollspy.
### Options
diff --git a/docs/4.0/components/tooltips.md b/docs/4.0/components/tooltips.md
index d3598048d..766b726ed 100644
--- a/docs/4.0/components/tooltips.md
+++ b/docs/4.0/components/tooltips.md
@@ -11,7 +11,7 @@ toc: true
Things to know when using the tooltip plugin:
- Tooltips rely on the 3rd party library [Popper.js](https://popper.js.org/) for positioning. You must include [popper.min.js]({{ site.cdn.popper }}) before bootstrap.js or use `bootstrap.bundle.min.js` / `bootstrap.bundle.js` which contains Popper.js in order for tooltips to work!
-- If building our JS from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
+- If you're building our JavaScript from source, it [requires `util.js`]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/javascript/#util).
- Tooltips are opt-in for performance reasons, so **you must initialize them yourself**.
- Tooltips with zero-length titles are never displayed.
- Specify `container: 'body'` to avoid rendering problems in more complex components (like our input groups, button groups, etc).