我正在尝试覆盖 antd 自动完成组件的样式。如果该组件被禁用,我想将光标更改为悬停时的默认值,而不是 antd 红色图标。
我正在使用样式化组件,所以我知道我必须直接重写 ant 类。这是我目前尝试过的方法,但没有成功。
&.ant-select-disabled {
cursor: default !important;
}
更新***
我找到了应该更改的类,如果我在检查中更改它,它会给出预期的行为,但将其添加到样式组件中不会在重新渲染时执行任何操作。
.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector input {
cursor: not-allowed;
}
你需要用CSS规则正确捕获元素;这将是适用的相关规则:
.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector {
cursor: default !important;
}