patternfly / patternfly/patternfly-react
Allow Label to set button component without onClick
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 862
- 派生
- 392
- 平均合并
- 4 天 8 小时
- 30 天内合并 PR
- 9
描述
Describe the enhancement or change
Currently, in order for a clickable Label to render with the button element in the DOM is to pass an onClick handler to it. There may be use cases where an onClick isn't desired - one example being the new Canvas pattern in Chatbot where a clickable Label opens a Popover. In this case the Popover is passed the Label as a child (rather than using triggerRefs and the Label's onClick to dictate the Popover open state).
Allowing Label to set a button element could help in those sorts of scenarios, instead of needing to pass a triggerRef, onClick to Label, and onHidden to Popover (which may result in some funky focus behavior).
Is this request originating from a Red Hat product team? If so, which ones and is there any sort of deadline for this enhancement?
Any other information?
Not blocking as there is a workaround of setting role and tabindex on a normal Label, but it lacks some focus styles and it would be better for us to support this internally with native elements.
Jira Issue: PF-4637
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 Label 组件及其现有测试入手,然后跟踪提供 onClick 时渲染元素的变化。定义一种受支持的方式来请求不带 onClick 的按钮,并验证 Label 会渲染出具有预期焦点行为的原生按钮,同时保持现有用法不变。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- react, typescript
- 领域
- frontend
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 68/100