palantir/blueprint

Cannot render Collapse inside table rows or cells

开放

#3,951 创建于 2020年2月2日

 (0 条评论) (3 个反应) (0 位负责人)TypeScript (2,167 个派生)batch import
P2Package: coreType: bughelp wanted

仓库指标

星标
 (20,263 个星标)
PR 合并指标
 (平均合并 43天 10小时) (30 天内合并 27 个 PR)

描述

Environment

  • Package version(s): 3.18
  • Browser and OS versions: Chrome 79.0.3945.117; Windows 10 Home OS Build: 18362.592

If possible, link to a minimal repro (fork this code sandbox): https://codesandbox.io/s/blueprint-sandbox-kxl82

Steps to reproduce

  1. Make Collapse element visible by clicking plus button

Actual behavior

Collapse renders a tr root element, then wraps the contents in an invalid <div> tag, which causes the browser to wrap the div in a td element. Discussed here: https://github.com/palantir/blueprint/issues/3652

Expected behavior

Collapse renders one or more tr elements containing td children into the existing table

Possible solution

The root tag specified by the component prop is rendered and passed container style classes, etc., but then a div tag is hardcoded as the direct child. The div would need to be removed, since it is not a valid child of a tr or other table elements. Could the properties currently embedded in the div be passed directly to the children?

贡献者指南