简体   繁体   English

Material-UI:如何控制扩展自动完成输入的position?

[英]Material-UI: How to control the position of the expanded autocomplete input?

I have some autocomplete fields: some autocomplete fields and i noticed that if i select multiple options, when i click on the input its height increases, like this , pushing everything down.我有一些自动完成字段:一些自动完成字段,我注意到如果我 select 有多个选项,当我点击输入时,它的高度会增加,就像这样,把所有东西都往下推。

Is there a way to control that?有没有办法控制它? I want to make it go above the content when expanded like that当像这样展开时,我想让它在内容上方 go

May be something like this can help you I think https://codesandbox.io/s/select-multiple-option-with-mui-and-react-hook-form-2kv2o可能是这样的东西可以帮助你我认为https://codesandbox.io/s/select-multiple-option-with-mui-and-react-hook-form-2kv2o

You can use the FormController and give it a width like shown in the sandbox您可以使用 FormController 并为其指定宽度,如沙箱中所示

Reference - React - Material-UI - How to use Select with multiple values inside react-hook-form参考 - React - Material-UI - 如何在 react-hook-form 中使用 Select 和多个值

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM