demarches-normaliennes/app/javascript/controllers/replace_attachment_controller.ts

14 lines
350 B
TypeScript
Raw Normal View History

import { ApplicationController } from './application_controller';
import { show } from '@utils';
export class ReplaceAttachmentController extends ApplicationController {
static targets = ['input'];
declare readonly inputTarget: HTMLInputElement;
open() {
show(this.inputTarget);
this.inputTarget.click(); // opens input prompt
}
}