fix(copy-button): ensure text is safely passed to clipboard
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<div class="relative" x-data="{ copied: false }">
|
||||
<input type="text" value="{{ $text }}" readonly class="input">
|
||||
<button
|
||||
@click.prevent="copied = true; navigator.clipboard.writeText('{{ $text }}'); setTimeout(() => copied = false, 1000)"
|
||||
@click.prevent="copied = true; navigator.clipboard.writeText({{ Js::from($text) }}); setTimeout(() => copied = false, 1000)"
|
||||
class="absolute right-2 top-1/2 -translate-y-1/2 p-1.5 text-gray-400 hover:text-gray-300 transition-colors"
|
||||
title="Copy to clipboard">
|
||||
<svg x-show="!copied" class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
|
Reference in New Issue
Block a user