From bf9526fe1921e60daa0375f39356bab5ea17ed35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Sun, 12 Jun 2022 16:44:30 +0200 Subject: [PATCH] Fix word counter --- resources/ts/components/bo/WordCounterComponent.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/ts/components/bo/WordCounterComponent.vue b/resources/ts/components/bo/WordCounterComponent.vue index 3ccfc09..0fed0b0 100644 --- a/resources/ts/components/bo/WordCounterComponent.vue +++ b/resources/ts/components/bo/WordCounterComponent.vue @@ -46,9 +46,10 @@ export default defineComponent({ throw new Error("Missing ID"); } const input = document.getElementById(this.id); - if (!input) { + if (!input || !(input instanceof HTMLInputElement)) { throw new Error(`Input ${this.id} could not be found`); } + this.input = input; }, input() { if (!this.input) {