You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Popovers rely on the 3rd party library [Popper.js](https://popper.js.org/) for positioning.
20
-
- Popovers with zero-length title _and_ content are never displayed.
21
30
- Specify `container` as `null` (default, appends to `<body>`) to avoid rendering problems in more
22
31
complex components (like input groups, button groups, etc). You can use `container` to optionally
23
32
specify a different element to append the rendered popover to.
@@ -26,22 +35,10 @@ Things to know when using popover component:
26
35
- When triggered from hyperlinks that span multiple lines, popovers will be centered. Use
27
36
`white-space: nowrap;` on your `<a>`s, `<b-link>`s and `<router-link>`s to avoid this behavior.
28
37
29
-
The `<b-popover>` component inserts a hidden (`display: none;`) `<div>` intermediate container
30
-
element at the point in the DOM where the `<b-popover>` component is placed. This may affect layout
31
-
and/or styling of components such as `<b-button-group>`, `<b-button-toolbar>`, and
32
-
`<b-input-group>`. To avoid these possible layout issues, place the `<b-popover>` component
33
-
**outside** of these types of components.
34
-
35
38
The target element **must** exist in the document before `<b-popover>` is mounted. If the target
36
39
element is not found during mount, the popover will never open. Always place your `<b-popover>`
37
40
component lower in the DOM than your target element.
38
41
39
-
**Note:**_When using slots for content and/or title, `<b-popover>` transfers the rendered DOM from
40
-
those slots into the popover's markup when shown, and returns them back to the `<b-popover>`
41
-
component when hidden. This may cause some issues in rare circumstances, so please test your
42
-
implementation accordingly! The `title` and `content` props do not have this behavior. For simple
43
-
popovers, we recommend using the `v-b-popover` directive and enable the `html` modifier if needed._
44
-
45
42
## Positioning
46
43
47
44
Twelve options are available for positioning: `top`, `topleft`, `topright`, `right`, `righttop`,
@@ -155,7 +152,8 @@ Positioning is relative to the trigger element.
155
152
## Triggers
156
153
157
154
Popovers can be triggered (opened/closed) via any combination of `click`, `hover` and `focus`. The
158
-
default trigger is `click`.
155
+
default trigger is `click`. Or a trigger of `manual` can be specified, where the popover can only be
156
+
opened or closed [programmatically](#programmatically-disabling-popover).
159
157
160
158
If a popover has more than one trigger, then all triggers must be cleared before the popover will
161
159
close. I.e. if a popover has the trigger `focus click`, and it was opened by `focus`, and the user
@@ -259,13 +257,14 @@ The special `blur` trigger **must** be used in combination with the `click` trig
259
257
|`disabled`|`false`| Programmatic control of the Popover display state. Recommended to use with [sync modifier](https://vuejs.org/v2/guide/components.html#sync-Modifier). |`true`, `false`|
260
258
|`triggers`|`'click'`| Space separated list of event(s), which will trigger open/close of popover using built-in handling |`hover`, `focus`, `click`. Note `blur` is a special use case to close popover on next click. |
261
259
|`no-fade`|`false`| Disable fade animation when set to `true`|`true` or `false`|
262
-
|`delay`|`0`| Delay showing and hiding of popover by specified number of milliseconds. Can also be defined as an object in the form of `{ show: 100, hide: 400 }` allowing different show and hide delays |`0` and up, integers only. |
260
+
|`delay`|`50`| Delay showing and hiding of popover by specified number of milliseconds. Can also be defined as an object in the form of `{ show: 100, hide: 400 }` allowing different show and hide delays |`0` and up, integers only. |
263
261
|`offset`|`0`| Shift the center of the popover by specified number of pixels. Also affects the position of the popover arrow. | Any negative or positive integer |
264
262
|`container`|`null`| Element string ID to append rendered popover into. If `null` or element not found, popover is appended to `<body>` (default) | Any valid in-document unique element ID. |
265
263
|`boundary`|`'scrollParent'`| The container that the popover will be constrained visually. The default should suffice in most cases, but you may need to change this if your target element is in a small container with overflow scroll |`'scrollParent'` (default), `'viewport'`, `'window'`, or a reference to an HTML element. |
266
264
|`boundary-padding`|`5`| Amount of pixel used to define a minimum distance between the boundaries and the popover. This makes sure the popover always has a little padding between the edges of its container. | Any positive number |
267
265
|`variant`|`null`| Contextual color variant for the popover | Any contextual theme color variant name |
268
-
|`customClass`|`null`| A custom classname to apply to the popover outer wrapper element | A string |
266
+
|`custom-class`|`null`| A custom classname to apply to the popover outer wrapper element | A string |
267
+
|`id`|`null`| An ID to use on the popover root element. If none is provided, one will automatically be generated. If you do provide an ID, it _must_ be guaranteed to be unique on the rendered page. | A valid unique element ID string |
269
268
270
269
### Variants and custom class
271
270
@@ -300,8 +299,7 @@ A custom class can be applied to the popover outer wrapper `<div>` by using the
300
299
</div>
301
300
```
302
301
303
-
**Note:** Custom classes will not work with scoped styles, as the popovers are appended to the
304
-
document `<body>` element by default.
302
+
`variant` and `custom-class` are reactive and can be changed while the popover is open.
305
303
306
304
Refer to the [popover directive](/docs/directives/popover) docs on applying variants and custom
307
305
class to the directive version.
@@ -582,7 +580,7 @@ Just need quick popovers without too much markup? Use the
0 commit comments