Skip to content

Commit

Permalink
Bug fix for TableView tooltip (#5158)
Browse files Browse the repository at this point in the history
* Single child for tooltip

---------

Co-authored-by: minhtuevo <[email protected]>
  • Loading branch information
minhtuev and minhtuevo committed Nov 20, 2024
1 parent 657419b commit 9625027
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ function Action(props: ActionPropsType) {

return tooltip ? (
<Tooltip title={tooltip}>
<span>{content}</span>{" "}
{/* Use <span> to wrap the child to avoid DOM issues */}
<span>{content}</span>
</Tooltip>
) : (
content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export default function TableView(props: ViewPropsType) {
selectedColumns.has(columnIndex);

const tooltip = tooltipMap[coordinate]; // Check if there's a tooltip for the cell

const content = formatCellValue(item[key], props);
const cell = (
<TableCell
key={key}
Expand All @@ -197,11 +197,9 @@ export default function TableView(props: ViewPropsType) {
>
{tooltip ? (
<Tooltip title={tooltip} arrow>
<span>{formatCellValue(item[key], props)}</span> {/* Wrap content with Tooltip */}
<span> {content} </span>
</Tooltip>
) : (
formatCellValue(item[key], props) // No Tooltip for cells without tooltips
)}
) : (content)}
</TableCell>
);

Expand Down

0 comments on commit 9625027

Please sign in to comment.