Material UI 筹码 - 阻止它们在激活时改变颜色

Material UI Chips - stop them changing color when active

如果您注意到下面的芯片编号 3 的背景颜色稍微深一些,因为我点击了它并且它处于活动状态。但是在clicked/active时不需要变色,因为只有删除按钮才有功能,所以click/active时芯片变暗没有意义。

如何设置样式以在用户单击纸条时停止这种背景颜色变化?

我认为自定义样式必须来自 React。在 devtools 中,我选择将元素设置为“:active”,但它不会改变颜色,所以我认为从 CSS 的角度来看它实际上不是“:active”。样式全部来自 React 和 Material UI 库,所以我认为我们必须在 React 组件中应用自定义样式才能工作。

However there is no need for it to change color on being clicked/active, because only the delete button has a function

请参考文档:

"Note that since no onTouchTap property is defined, the Chip can be focused, but does not gain depth while clicked or touched."

http://www.material-ui.com/#/components/chip

该芯片具有焦点颜色,以便用户可以判断它何时聚焦(无论是通过键盘、鼠标还是触摸)。聚焦的条块接收退格键输入,因此用户需要一个视觉提示来确定哪个条块将被删除。

来源:我写了Chip组件。