const style = {
control: base => ({
...base,
border: 0,
// This line disable the blue border
boxShadow: 'none'
})
};
这是live example美元
要在Select
聚焦时重置边界,有两种解决方案:
使用state
control: (base, state) => ({
...base,
border: state.isFocused ? 0 : 0,
// This line disable the blue border
boxShadow: state.isFocused ? 0 : 0,
'&:hover': {
border: state.isFocused ? 0 : 0
}
})
使用!important
(这一款有效,但我建议使用第一款
control: base => ({
...base,
border: '0 !important',
// This line disable the blue border
boxShadow: '0 !important',
'&:hover': {
border: '0 !important'
}
})
别忘了重置你得到的boxShadow
(蓝色边框).
这是live example美元.