-
Notifications
You must be signed in to change notification settings - Fork 904
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(menu): add document-level positioning
related #5120 PiperOrigin-RevId: 580293404
- Loading branch information
1 parent
f08ecce
commit 2b591ca
Showing
11 changed files
with
282 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<div class="figure-wrapper"> | ||
<figure | ||
style="justify-content: center" | ||
aria-label="A filled button that says open document menu. Interact with the button to open a document menu." | ||
> | ||
<div> | ||
<div style="margin: 16px"> | ||
<md-filled-button id="usage-document-anchor">Open document menu</md-filled-button> | ||
</div> | ||
<md-menu positioning="document" id="usage-document" anchor="usage-document-anchor"> | ||
<md-menu-item> | ||
<div slot="headline">Apple</div> | ||
</md-menu-item> | ||
<md-menu-item> | ||
<div slot="headline">Banana</div> | ||
</md-menu-item> | ||
<md-menu-item> | ||
<div slot="headline">Cucumber</div> | ||
</md-menu-item> | ||
</md-menu> | ||
</div> | ||
<script type="module"> | ||
const anchorEl = document.body.querySelector("#usage-document-anchor"); | ||
const menuEl = document.body.querySelector("#usage-document"); | ||
anchorEl.addEventListener("click", () => { | ||
menuEl.open = !menuEl.open; | ||
}); | ||
</script> | ||
</figure> | ||
</div> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.