question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Menu] Add a Dropdown example

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Since Menu inherited from Popover, we should be able to change the value of anchorOrigin.

Current Behavior

Changing the property vertical of anchorOrigin change nothing. The Menu is still attached to the top of the anchor. horizontal property works great.

Steps to Reproduce

https://codesandbox.io/s/6nllq0zzlz

SimpleMenu doesn’t take into accounts the vertical property of anchorOrigin. SimplePopover is the same code, with Menu replaced with Popover (and the expected behavior).

Your Environment

Tech Version
Material-UI 1.0.0-beta.38
React 16.2.0
browser Chrome 65

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

63reactions
oliviertassinaricommented, Mar 26, 2018
        <Menu
          anchorEl={anchorEl}
          anchorOrigin={{
            vertical: "bottom",
            horizontal: "right"
          }}
+         getContentAnchorEl={null}

https://codesandbox.io/s/x8k6446oz

1reaction
micksatanacommented, May 8, 2019

The example having both anchorOrigin and transformOrigin

<Menu
  anchorOrigin={{
    vertical: 'top',
    horizontal: 'right',
  }}
  transformOrigin={{
    vertical: 'top',
    horizontal: 'right',
  }}

In my case, I remove transformOrigin and it works!

<Menu
  anchorOrigin={{
    vertical: 'top',
    horizontal: 'right',
  }}

Hope this helps someone

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Create a Dropdown Menu With CSS and JavaScript
Create a dropdown menu that appears when the user clicks on a button. Step 1) Add HTML: Example. <div class="dropdown">
Read more >
How to Create an HTML Dropdown Menu [+ Examples]
Step 1: Add a <label> element to your HTML document. This will be the name of your dropdown menu. · Step 2: Add...
Read more >
50 Examples of Drop-Down Navigation Menus in Web Designs
50 Examples of Drop-Down Navigation Menus in Web Designs · 1. Pure Grips · 2. Porsche · 3. B&Q · 4. Red Brick...
Read more >
HTML Drop-down Menu – How to Add a Drop-Down List with ...
In this article, you will learn how to add a drop-down list to the select element on your webpage. You'll also learn the...
Read more >
Ten Examples of Dropdown Menus on Websites
Ten Examples of Dropdown Menus on Websites · 1. RTI · 2. Fleet Feet · 3. Kenan Flagler · 4. Moishe House ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found