[Proposal] Add topmost className prop and merge it into trigger element
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
从 issue 中描述的 Trigger 实现的子元素克隆路径开始,检查 props 如何合并到 trigger 元素中。添加提议的顶层 className 行为,保留子元素的 className,并验证生成的 trigger 同时接收到两个 class。
由索引模型根据 Issue 内容生成。
描述
Due to this issue: https://github.com/ant-design/ant-design/issues/10325, I suggest that we add className as a prop of Trigger for convenience.
Current
const props = this.props;
const children = props.children;
const child = React.Children.only(children);
const newChildProps = { key: 'trigger' };
// Merge some event handlers into `newChildProps`
const trigger = React.cloneElement(child, newChildProps);
Expected
import classNames from 'classnames';
// ...
const props = this.props;
const children = props.children;
const child = React.Children.only(children);
const newChildProps = {
key: 'trigger',
className: classNames(props.className, child.props.className),
};
// Merge some event handlers into `newChildProps`
const trigger = React.cloneElement(child, newChildProps);
| name | type | default | description |
|---|---|---|---|
| className | string | additional className added to trigger |
@yesmeck Shall I create a PR directly? Thanks.
- 主要语言
- TypeScript
- 星标
- 392
- 派生
- 250
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
react-component/trigger 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
react-component/trigger#593 · 1 个 reaction ·
-
useAlign reuses a stale flip decision after the viewport changes (popup stays flipped until reopen)可能已有人在做 @SXongin 于 34 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 30/100
react-component/trigger#651 ·
-
Does not work when rendered inside an iframe可能已有人在做 @PinkChampagne17 于 185 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 58/100
react-component/trigger#623 ·
-
useAlign.js: inline style reset to 0 is silently overridden under prefers-reduced-motion CSS (CSSTransition interpolation)可能已有人在做 @baofuen 于 144 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 65/100
react-component/trigger#618 · 1 条评论 ·
-
`collectScroller` is not working as expected when the element is in shadow DOM可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 3/5 1-2 天 新手友好度 42/100
react-component/trigger#555 ·
查看 react-component/trigger 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
zabuton-app/meguri#875 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 86/100
iruzen-dono/workless#117 ·
维护者通常 1 天内回复
-
area:api area:web wave wave:trivial
难度 2/5 1-3 小时 新手友好度 67/100
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
vetro-protocol/vetro-monorepo#1321 ·
维护者通常 1 天内回复