Tencent / Tencent/tdesign-react
[Dropdown 下拉菜单] 添加菜单展开/收起的回调
Open
Nobody has claimed this yet.
💪🏻 enhancement
usage
- Dominant language
- TypeScript
- Stars
- 965
- Forks
- 373
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 17
Description
这个功能解决了什么问题
在自定义下拉框内容的场景中,很多时候需要知晓菜单的展开/收起时机,以便实现对应的逻辑。举个例子:
类似这种菜单的功能,为了优化性能,我希望在完成全部的勾选项,关闭菜单后,才触发一次后台请求。现在没有展开/收起的回调,我只能操作一个就往后台发一次请求。
你建议的方案是什么
给 添加 onShow 和 onHide 回调,分别在展示菜单、关闭菜单时触发。
Contributor guide
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 by locating the Dropdown component and its existing menu visibility and event API. Trace how the menu opens and closes, then verify that the new onShow and onHide callbacks fire at the corresponding times, including when custom dropdown content is used.
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
- Clearly specified
- Newbie friendliness
- 45/100