Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
441 views
in Technique[技术] by (71.8m points)

reactjs - Dropdown on button click using Material UI

How to show dropdown on button click using material ui?

Currently, I'm able to do so but extra select field is getting populated which is not required. I don't want to hide select field with css.

Also, How can I change width, height, position and other properties of generated popover using material ui? codesandbox url: https://codesandbox.io/s/du8mr

current implementation

popover


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can use Menu component instead of a Select component.

You can change the Menu props using MenuProps which receives all Popover props.

From Menu documentation:

Any other props supplied will be provided to the root element (Popover).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...