删除React Material UI组件中自动完成的下划线样式 [英] Removing underline style of autocomplete in react material ui component
问题描述
我想删除下划线样式,并在文本字段聚焦到反应材料ui的自动完成组件中时更改其颜色.
I want to remove the underline style and change the of the color of it when the text field gets focus in the autocomplete component of react material ui.
我似乎找不到要覆盖的样式.
I can't seem to find the style to override.
谢谢.
推荐答案
您可以使用呈现给< AutoComplete/>的
组件.因为< TextField/>
道具来完成此操作;< AutoComplete/>
使用< TextField/>
,所以您可以使用这些道具.因此,实际上您有两种消除自动完成功能下划线的方法.不幸的是,这在Material-UI文档中没有记录,无法自动完成.
You can accomplish this using the <TextField/>
props that are rendered to the <AutoComplete/>
component. Because <AutoComplete />
uses the <TextField/>
you have access to those props. So you actually have two ways of removing the underline of the autocomplete. Unfortunately this is undocumented in the Material-UI docs for autocomplete.
<自动完成underlineStyle = {{{display:'none'}}>
或
< AutoComplete underlineShow = {false}>
edit:此答案与旧版Material UI相关.此答案不适用于1.0或更高版本.
edit: This answer is relevant to older versions of Material UI. This answer does not work for version 1.0 or higher.
这篇关于删除React Material UI组件中自动完成的下划线样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!