Skip to content

Commit

Permalink
fix(menu): declare popover API types
Browse files Browse the repository at this point in the history
Without it show/hide popover get renamed by closure.

PiperOrigin-RevId: 582471354
  • Loading branch information
material-web-copybara authored and Copybara-Service committed Nov 15, 2023
1 parent 128abcb commit bf8d3f6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions menu/internal/controllers/surfacePositionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@
import {ReactiveController, ReactiveControllerHost} from 'lit';
import {StyleInfo} from 'lit/directives/style-map.js';

/**
* Declare popoverAPI functions. See
* https://developer.mozilla.org/en-US/docs/Web/API/Popover_API
* Without this, closure will rename these functions. Can remove once these
* functions make it into the typescript lib.
*/
declare global {
interface HTMLElement {
showPopover(): void;
hidePopover(): void;
togglePopover(force: boolean): void;
}
}

/**
* An enum of supported Menu corners
*/
Expand Down

0 comments on commit bf8d3f6

Please sign in to comment.