Files
manyfold/app/javascript/controllers/copy_text_controller.ts
2025-06-07 12:07:34 +01:00

15 lines
283 B
TypeScript

import { Controller } from '@hotwired/stimulus'
// Connects to data-controller="editable"
export default class extends Controller {
static values = {
text: String
}
declare textValue: string
copy (): void {
void navigator.clipboard.writeText(this.textValue)
}
}