Skip to content
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

Add imperative invoker updates to popover API #37133

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions files/en-us/web/api/htmlelement/showpopover/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ When `showPopover()` is called on an element with the [`popover`](/en-US/docs/We
## Syntax

```js-nolint
showPopover()
showPopover(options)
hamishwillee marked this conversation as resolved.
Show resolved Hide resolved
```

### Parameters

None.
- `options` {{optional_inline}}
- : An object with the following properties:
- `source` {{optional_inline}}
- An {{domxref("HTMLElement")}} that triggered the popover, if any. This provides all the same functionality that using
[`popovertarget`](/en-US/docs/Web/HTML/Element/button#popovertarget) would provide.
hamishwillee marked this conversation as resolved.
Show resolved Hide resolved

### Return value

Expand Down
12 changes: 11 additions & 1 deletion files/en-us/web/api/htmlelement/togglepopover/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,24 @@ When `togglePopover()` is called on an element with the [`popover`](/en-US/docs/

```js-nolint
togglePopover(force)
togglePopover(options)
```

### Parameters

- `force`
- `force` {{optional_inline}}
- : A boolean, which causes `togglePopover()` to behave like {{domxref("HTMLElement.showPopover", "showPopover()")}} or {{domxref("HTMLElement.hidePopover", "hidePopover()")}}, except that it doesn't throw an exception if the popover is already in the target state.
- If set to `true`, the popover is shown if it was initially hidden. If it was initially shown, nothing happens.
- If set to `false`, the popover is hidden if it was initially shown. If it was initially hidden, nothing happens.
- `options` {{optional_inline}}
- : An object with the following properties:
- `force` {{optional_inline}}
- : A boolean, which causes `togglePopover()` to behave like {{domxref("HTMLElement.showPopover", "showPopover()")}} or {{domxref("HTMLElement.hidePopover", "hidePopover()")}}, except that it doesn't throw an exception if the popover is already in the target state.
- If set to `true`, the popover is shown if it was initially hidden. If it was initially shown, nothing happens.
- If set to `false`, the popover is hidden if it was initially shown. If it was initially hidden, nothing happens.
- `source` {{optional_inline}}
- An {{domxref("HTMLElement")}} that triggered the popover, if any. This provides all the same functionality that using
[`popovertarget`](/en-US/docs/Web/HTML/Element/button#popovertarget) would provide.
hamishwillee marked this conversation as resolved.
Show resolved Hide resolved

### Return value

Expand Down
Loading