-
-
Notifications
You must be signed in to change notification settings - Fork 78.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates docs to match Tooltip type checking #22342
Conversation
0c4614e
to
99e82eb
Compare
docs/components/popovers.md
Outdated
@@ -181,7 +181,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap | |||
</tr> | |||
<tr> | |||
<td>container</td> | |||
<td>string | false</td> | |||
<td>string | element | boolean</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you felt like it, you could also change false
to boolean
on the tooltip container docs too:
From:
<td>container</td>
<td>string | element | false</td>
to:
<td>container</td>
<td>string | element | boolean</td>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed with @samjewell
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly, if you actually set container: true
then the tooltip/popover won't work properly, because of this line:
var container = this.config.container === false ? document.body : $(this.config.container);
I'm actually going to change these updates back to false
to make that clear. The important thing for this PR is that element
is added.
@gareth you have conflicts in your issue can you update your branch please ? |
Documentation now matches the types defined in the DefaultType constant in js/src/tooltip.js
d7ce9e7
to
0d8ae6d
Compare
@Johann-S Rebased |
Spotted when looking up documentation for Popups, and wondering why a raw element couldn't be passed in as a
container
according to the documentation - I looked in the source and saw that it could – whatever's incontainer
(if truthy) gets passed into jQuery's appendTo!I also spotted that the Tooltip type checking explicitly allows for an element to be passed, it's literally just that the documentation is out of sync.
With this change, the documentation for Tooltip and Popover now matches the types defined in the DefaultType constant in js/src/tooltip.js