Files
manyfold/app/frontend/javascript/controllers/copy_text_controller.ts
T

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)
}
}