react-component / react-component/select
Select Arrow Icon
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 938
- Forks
- 482
- Avg merge
- 15h 8m
- Merged PRs (30d)
- 2
Description
arrowNode = (
<TransBtn
className={classNames(`${prefixCls}-arrow`, {
[`${prefixCls}-arrow-loading`]: loading,
+ [`${prefixCls}-arrow-clear`]: mergedAllowClear,
})}
customizeIcon={suffixIcon}
customizeIconProps={{
loading,
searchValue: mergedSearchValue,
open: mergedOpen,
focused: mockFocused,
showSearch: mergedShowSearch,
}}
/>
);
我通过 createPortal 在后缀插入其他图标后,改变现有 .ant-select:hover .ant-select-arrow:not(:last-child) {opacity: 0;} 样式我可能需要自行维护 mergedAllowClear 变量,判断hover时是否存在 clear 图标,存在才隐藏。能否将这个变量传递给 arrow 图标,这样包装层可以减少很多代码
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from the Select arrow rendering shown in the issue, including arrowNode, TransBtn, and mergedAllowClear, and trace how the arrow receives its props and how the hover CSS selector hides arrows. Done means the arrow can use the clear-state information so custom suffix icons inserted with createPortal do not require wrapper-maintained logic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100