ClipboardCopy currently truncates at the end. It may be nice in some cases to truncate at the start or middle (similar to how Truncate component works).
A workaround could currently work with inline-compact with some hacking, see https://codesandbox.io/p/sandbox/red-wind-zdgyqf
<ClipboardCopy
variant={"inline-compact"}
style={{ display: "inline-flex" }}
clickTip="Copied"
onCopy={() => {
navigator.clipboard.writeText(textToCopy);
}}
>
<Truncate
content={textToCopy}
trailingNumChars={10}
position={"middle"}
/>
</ClipboardCopy>
However, this wouldn't work with other variants. They all use TextInput, as part of this feature I believe TextInput would also have to be updated to work with middle truncate (currently it only has start/end).
Could use props like truncatePosition, and truncateTrailingNumChars for middle.
This came up in a slack conversation with Vince Consola and @christianvogt
It would also be nice if inline-compact supported truncate by itself as well.
ClipboardCopy currently truncates at the end. It may be nice in some cases to truncate at the start or middle (similar to how
Truncatecomponent works).A workaround could currently work with
inline-compactwith some hacking, see https://codesandbox.io/p/sandbox/red-wind-zdgyqfHowever, this wouldn't work with other variants. They all use
TextInput, as part of this feature I believeTextInputwould also have to be updated to work with middle truncate (currently it only has start/end).Could use props like
truncatePosition, andtruncateTrailingNumCharsfor middle.This came up in a slack conversation with Vince Consola and @christianvogt
It would also be nice if
inline-compactsupportedtruncateby itself as well.