Fix word counter

This commit is contained in:
Jérémy Munsch 2022-06-12 16:44:30 +02:00
parent c9bc8d37ec
commit bf9526fe19
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC

View file

@ -46,9 +46,10 @@ export default defineComponent({
throw new Error("Missing ID"); throw new Error("Missing ID");
} }
const input = document.getElementById(this.id); const input = document.getElementById(this.id);
if (!input) { if (!input || !(input instanceof HTMLInputElement)) {
throw new Error(`Input ${this.id} could not be found`); throw new Error(`Input ${this.id} could not be found`);
} }
this.input = input;
}, },
input() { input() {
if (!this.input) { if (!this.input) {