diff --git a/button/copy/copy.view.ts b/button/copy/copy.view.ts index e615b9df8d3..9788a11d90b 100644 --- a/button/copy/copy.view.ts +++ b/button/copy/copy.view.ts @@ -24,8 +24,13 @@ namespace $.$$ { click( event?: Event ) { const cb = $mol_wire_sync( this.$.$mol_dom_context.navigator.clipboard ) - cb.writeText( this.text() ) // fallback - cb.write( this.attachments() ) + + cb.writeText?.( this.text() ) + cb.write?.( this.attachments() ) + + if( cb.writeText === undefined && cb.write === undefined ) { + throw new Error( "doesn't support copy to clipoard" ) + } } }