We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cc603bf commit 9a0f443Copy full SHA for 9a0f443
button/copy/copy.view.ts
@@ -24,12 +24,12 @@ namespace $.$$ {
24
25
click( event?: Event ) {
26
const cb = $mol_wire_sync( this.$.$mol_dom_context.navigator.clipboard )
27
-
28
- if( cb.writeText ) cb.writeText( this.text() )
29
- if( cb.write ) cb.write( this.attachments() )
+
+ cb.writeText?.( this.text() )
+ cb.write?.( this.attachments() )
30
31
if( cb.writeText === undefined && cb.write === undefined ) {
32
- throw new Error( "Browser cannot support write functions" )
+ throw new Error( "doesn't support copy to clipoard" )
33
}
34
35
0 commit comments