dash
dash copied to clipboard
[Feature Request] Copy only text data in DataTable cell
[Feature Request] Copy only text data in DataTable cell
Current
- html tag of table to be copied
<td
tabindex="-1"
class="dash-cell column-13 cell--selected focused"
data-dash-column="some column"
data-dash-row="0"
>
<div class="input-active unfocused dash-cell-value cell-markdown">
<div class="center">
0
</div>
</div>
</td>
- Copied Results
<div class='center'>0</div>
Solution
Add parameter such as copyOnlyText that only text data are copied.
Or, it would be good to apply it when the presentation of the cell is markdown.
When calling the toClipboard function, it would be good to get an argument and remove the html tag using the regex.
- To use a
DataTablewith ancopyOnlyTextargument
DataTable(
df.to_dict('records'),
[{"name": i, "id": i, presentation="markdown"} for i in df.columns],
id='tbl',
copyOnlyText=True,
)
If the html like the above behavior is rendered, if the copyOnlyText argument is passed, it seems that only 0 should be copied.