I want to add a tooltip to JSON formatted field, but it doesn't work. I have the following code:
const displayDeletedDataInJSON = (column: ITableColumn) => {
return (rowData: any): JSX.Element => {
const formatedJson = formatObjectInJson(
column.field,
rowData[`${column.field}`]
);
return rowData[`${column.field}`] ? (
<React.Fragment>
<DeletedDataTemplate>
{" "}
<pre id={`deleted-data-${column.header}`}>
{JSON.stringify(formatedJson, null, 2).replace(/["[,\]]/g, "")}
</pre>
</DeletedDataTemplate>
<Tooltip
target={`deleted-data-${column.header}`}
content={rowData[$`{column.field}`]}
//showDelay={1000}
position={"left"}
/>
</React.Fragment>
) : (
<span></span>
);
};
};
rowData and column are objects with different properties. The property column.header is always different for the different column objects.
DeletedDataTemplate is a custom css.
I tried changing the ids, their positions (for example I put the id to the DeletedDataTemplate). I used a dummy content string = "fdsfsda", to check if the problem comes from the content, but it didnt work.
I want to make this tooltip working.
I will be very grateful, if you give me some ideas and could help me out.