antd Radio組件,樣式小問題

引入antdRadio組件,使用disabled的狀況下(Radio.Group中第二個爲默認選中)。會出現藍色border。

import { Radio } from 'antd'

 <Radio.Group disabled defaultValue="b" size="large">
    <Radio.Button value="a">Hangzhou</Radio.Button>
    <Radio.Button value="b">Shanghai</Radio.Button>
    <Radio.Button value="c">Beijing</Radio.Button>
    <Radio.Button value="d">Chengdu</Radio.Button>
</Radio.Group>
複製代碼

效果如圖(放大必定倍數),發現默認選中,左側border有藍色背景。(不清晰,可是能夠發現一點點)

藍色可能不太明顯,換成紅色試試看

可見,處理非disabledcss的樣式,被應用到了當前狀況下。

修改:

.ant-radio-button-wrapper-checked.ant-radio-button-wrapper-disabled:not(:first-child)::before {
    background-color: #d9d9d9 !important;
}
複製代碼

如圖,可見問題解決

偏右老哥給的回答,人家已經修復了。

相關文章
相關標籤/搜索