Sha256: 1b1874f75508fcb75238dc761cd34bbfb3394fa66842d8a6345f8f750324532a

Contents?: true

Size: 285 Bytes

Versions: 2

Compression:

Stored size: 285 Bytes

Contents

import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
  static targets = [ "input" ]

  async copy() {
    try {
      await navigator.clipboard.writeText(this.inputTarget.value)
    } catch (error) {
      console.warn(error.message);
    }
  }
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
css-zero-0.0.37 lib/generators/css_zero/add/templates/app/javascript/controllers/copyable_input_controller.js
css-zero-0.0.36 lib/generators/css_zero/add/templates/app/javascript/controllers/copy_button_controller.js