Tencent / Tencent/tdesign-react

[Dropdown 下拉菜单] 添加菜单展开/收起的回调

Open
#2,989 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

💪🏻 enhancement usage
Dominant language
TypeScript
Stars
965
Forks
373
Avg merge
3d 6h
Merged PRs (30d)
17

Description

这个功能解决了什么问题

在自定义下拉框内容的场景中,很多时候需要知晓菜单的展开/收起时机,以便实现对应的逻辑。举个例子:
image
类似这种菜单的功能,为了优化性能,我希望在完成全部的勾选项,关闭菜单后,才触发一次后台请求。现在没有展开/收起的回调,我只能操作一个就往后台发一次请求。

你建议的方案是什么

给 添加 onShowonHide 回调,分别在展示菜单、关闭菜单时触发。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.