Umbraco.UI icon indicating copy to clipboard operation
Umbraco.UI copied to clipboard

Feature: Field with copy button

Open iOvergaard opened this issue 4 years ago • 3 comments

It would be beneficial to have a component that exposes a text that can be copied by clicking a button. The copy functionality should work cross-browser and have some kind of interaction to know you clicked.

Example:

copy-code

iOvergaard avatar Mar 11 '22 12:03 iOvergaard

FYI, GitHub (the org) has a <clipboard-copy> standalone web component. If it helps? https://github.com/github/clipboard-copy-element

I found this on the Awesome Standalones repo, (for framework-agnostic standalone web components).

leekelleher avatar Mar 29 '22 21:03 leekelleher

Cool, let me add that styling wise we should aim for the same look as the Password Input. So it aligns with the general input style, and appends the copy button at the end of the field.

Notice for the right experience you should append readonly on the input field. maybe this one should extend the UUI-input component.

nielslyngsoe avatar Oct 03 '23 12:10 nielslyngsoe

@nielslyngsoe To clarify, should the copy button be an additional property on the UUI-input that will also set readonly when enabled or should the copy button be visible when readonly is enabled? I'll have a go and look at this.

Nukeclears avatar Oct 12 '23 14:10 Nukeclears