如何摆脱或删除 react-select 中的 spinners/arrows?
How to get rid of or remove spinners/arrows in react-select?
我正在使用 react-select 但我无法从下拉列表中删除 spinners/arrows。
我可以删除默认分隔符 |和下拉指示器使用
<Select
components={{
IndicatorSeparator: () => null, DropdownIndicator: () => null
}}
{...}
/>
但是我怎样才能去掉这些箭头呢?
我相信您在某处为 input
元素设置了 type=number
。为了去掉up/down箭头。您可以使用 this 教程中的 css 代码。
您还可以查看所有输入类型及其呈现方式 out-of-the-box here。
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}
现场演示
我正在使用 react-select 但我无法从下拉列表中删除 spinners/arrows。
我可以删除默认分隔符 |和下拉指示器使用
<Select
components={{
IndicatorSeparator: () => null, DropdownIndicator: () => null
}}
{...}
/>
但是我怎样才能去掉这些箭头呢?
我相信您在某处为 input
元素设置了 type=number
。为了去掉up/down箭头。您可以使用 this 教程中的 css 代码。
您还可以查看所有输入类型及其呈现方式 out-of-the-box here。
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}