@@ -83,7 +83,7 @@ export class UUICopyElement extends LabelMixin('', LitElement) {
8383 // Used to store the value that will be copied to the clipboard
8484 #valueToCopy = '' ;
8585
86- #onClick = async ( e : Event ) => {
86+ readonly #onClick = async ( e : Event ) => {
8787 const button = e . target as UUIButtonElement ;
8888 button . state = 'waiting' ;
8989
@@ -96,7 +96,7 @@ export class UUICopyElement extends LabelMixin('', LitElement) {
9696 const el = document . getElementById ( this . copyFrom ) ;
9797 if ( el ) {
9898 console . log ( 'Element found to copy from' , el ) ;
99- this . #valueToCopy = el . textContent || el . innerText || '' ;
99+ this . #valueToCopy = el . textContent ?? el . innerText ?? '' ;
100100
101101 // Override the value to copy ,if the element has a value property
102102 // Such as uui-input or uui-textarea or native inout elements
@@ -123,7 +123,6 @@ export class UUICopyElement extends LabelMixin('', LitElement) {
123123 await navigator . clipboard
124124 . writeText ( this . #valueToCopy)
125125 . then ( ( ) => {
126- //button.state = 'success';
127126 this . dispatchEvent (
128127 new UUICopyEvent ( UUICopyEvent . COPIED , {
129128 detail : { text : this . #valueToCopy } ,
@@ -151,7 +150,7 @@ export class UUICopyElement extends LabelMixin('', LitElement) {
151150 </ uui- butto n> ` ;
152151 }
153152
154- static styles = [
153+ static readonly styles = [
155154 css `
156155 slot {
157156 pointer-events : none;
0 commit comments