admin管理员组文章数量:1334390
I am trying to make the size of the react-select's Select ponent smaller. Everything works pretty well with one exception.
The element whose padding I wish to remove has this class: css-tlfecz-indicatorContainer
and is a subponent of the react-select Select
ponent, more precisely, the subponent responsible of rendering the × sign for clearing the selection.
I have tried putting this in the styles prop of the Select:
indicatorsContainer: (provided, state) => {
return {
...provided,
padding: '0px',
paddingLeft: '0px',
paddingTop: '0px',
paddingRight: '0px',
paddingDown: '0px',
};
},
But it does not work. I expected that there was an indicatorContainer styleable ponent, so that I do not have to override ponents with my own ponents, but I think this is the only way.
A screenshot of how the Select looks like if I change the styles manually from the DevTools' Elements tab:
There are no error messages.
Thank you.
I am trying to make the size of the react-select's Select ponent smaller. Everything works pretty well with one exception.
The element whose padding I wish to remove has this class: css-tlfecz-indicatorContainer
and is a subponent of the react-select Select
ponent, more precisely, the subponent responsible of rendering the × sign for clearing the selection.
I have tried putting this in the styles prop of the Select:
indicatorsContainer: (provided, state) => {
return {
...provided,
padding: '0px',
paddingLeft: '0px',
paddingTop: '0px',
paddingRight: '0px',
paddingDown: '0px',
};
},
But it does not work. I expected that there was an indicatorContainer styleable ponent, so that I do not have to override ponents with my own ponents, but I think this is the only way.
A screenshot of how the Select looks like if I change the styles manually from the DevTools' Elements tab:
There are no error messages.
Thank you.
Share Improve this question asked Sep 2, 2020 at 9:36 silviubogansilviubogan 3,4613 gold badges37 silver badges67 bronze badges 1- @RokoC.Buljan The height of the Select should match the height of the toolbar in which it is placed. – silviubogan Commented Sep 2, 2020 at 9:37
2 Answers
Reset to default 5You'll need to style dropdownIndicator
and clearIndicator
instead of indicatorContainer
.
In the snippet in the question I just had to replace indicatorsContainer
with clearIndicator
. This clearIndicator
is not rendered with a class like clearIndicator
but with indicatorContainer
(without s
after indicator
) and this confused me.
本文标签:
版权声明:本文标题:javascript - How to remove the padding of the indicatorContainer (first child of IndicatorsContainer)? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742243920a2439008.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论